[Devel] [RFC] Fix get_exec_env() races

2015-10-15 Thread Kirill Tkhai
Since we allow to attach a not current task to ve cgroup, there is the race in the places where we use get_exec_env(). The task's ve may be changed after it dereferenced get_exec_env(), so a lot of problems are possible there. I'm sure the most places, where we use get_exec_env(), was not written

Re: [Devel] [PATCH RH7 1/2] device_cgroup: fake allowing all devices for docker inside VZCT

2015-10-15 Thread Pavel Tikhomirov
Here is the right link for RH7: https://jira.sw.ru/browse/PSBM-34529 Patch actually is a port from RH6. On 10/15/2015 01:42 PM, Konstantin Khorenko wrote: Volodya, please review. -- Best regards, Konstantin Khorenko, Virtuozzo Linux Kernel Team On 10/13/2015 06:11 PM, Pavel Tikhomirov

[Devel] [PATCH RHEL7 COMMIT] ms/selftests: add memfd/sealing page-pinning tests

2015-10-15 Thread Konstantin Khorenko
The commit is pushed to "branch-rh7-3.10.0-229.7.2.vz7.8.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git after rh7-3.10.0-229.7.2.vz7.8.6 --> commit 07e7c92c1c0de74828dfd29e39facebf02cdfd63 Author: Andrew Vagin Date: Thu Oct 15 15:04:19 2015 +0400

[Devel] [PATCH RHEL7 COMMIT] ms/shm: wait for pins to be released when sealing

2015-10-15 Thread Konstantin Khorenko
The commit is pushed to "branch-rh7-3.10.0-229.7.2.vz7.8.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git after rh7-3.10.0-229.7.2.vz7.8.6 --> commit c49f7bf80c6e70a3992c13f6b7f7a60b44c81dce Author: Andrew Vagin Date: Thu Oct 15 15:04:19 2015 +0400

[Devel] [PATCH RHEL7 COMMIT] ms/sched: add cond_resched_rcu() helper

2015-10-15 Thread Konstantin Khorenko
The commit is pushed to "branch-rh7-3.10.0-229.7.2.vz7.8.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git after rh7-3.10.0-229.7.2.vz7.8.6 --> commit f5375ae5711c334bb1305639dc08a45898a32f19 Author: Andrew Vagin Date: Thu Oct 15 15:04:15 2015 +0400

[Devel] [PATCH RHEL7 COMMIT] ms/prctl: PR_SET_MM -- introduce PR_SET_MM_MAP operation

2015-10-15 Thread Konstantin Khorenko
The commit is pushed to "branch-rh7-3.10.0-229.7.2.vz7.8.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git after rh7-3.10.0-229.7.2.vz7.8.6 --> commit 19e5b6f0c09fa1a46634605cec0c212a106044ee Author: Andrew Vagin Date: Thu Oct 15 15:04:13 2015 +0400

[Devel] [PATCH RHEL7 COMMIT] ms/shm: add memfd_create() syscall

2015-10-15 Thread Konstantin Khorenko
The commit is pushed to "branch-rh7-3.10.0-229.7.2.vz7.8.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git after rh7-3.10.0-229.7.2.vz7.8.6 --> commit 9e421edd0c467fb8d3a230520421a58f55e2a46e Author: Andrew Vagin Date: Thu Oct 15 15:04:18 2015 +0400

[Devel] [PATCH RHEL7 COMMIT] ms/prctl: PR_SET_MM -- factor out mmap_sem when updating mm::exe_file

2015-10-15 Thread Konstantin Khorenko
The commit is pushed to "branch-rh7-3.10.0-229.7.2.vz7.8.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git after rh7-3.10.0-229.7.2.vz7.8.6 --> commit bf86a407af9fa74c7251b62c539f36c141fc4f77 Author: Andrew Vagin Date: Thu Oct 15 15:04:13 2015 +0400

[Devel] [PATCH RHEL7 COMMIT] ms/aio: Make it possible to remap aio ring

2015-10-15 Thread Konstantin Khorenko
The commit is pushed to "branch-rh7-3.10.0-229.7.2.vz7.8.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git after rh7-3.10.0-229.7.2.vz7.8.6 --> commit a3ffce64acc927dd35825252566389966520dc94 Author: Andrew Vagin Date: Thu Oct 15 15:04:14 2015 +0400

[Devel] [PATCH RHEL7 COMMIT] ms/make default ->i_fop have ->open() fail with ENXIO

2015-10-15 Thread Konstantin Khorenko
The commit is pushed to "branch-rh7-3.10.0-229.7.2.vz7.8.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git after rh7-3.10.0-229.7.2.vz7.8.6 --> commit ab6784bb6f5bca77caef0e23d07e0b86dd178557 Author: Andrew Vagin Date: Thu Oct 15 15:04:20 2015 +0400

[Devel] [PATCH RHEL7 COMMIT] ms/mm: mmap_region: kill correct_wcount/inode, use allow_write_access()

2015-10-15 Thread Konstantin Khorenko
The commit is pushed to "branch-rh7-3.10.0-229.7.2.vz7.8.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git after rh7-3.10.0-229.7.2.vz7.8.6 --> commit 55c695be4110abbbc0c16bd2f6d55de27ac03b90 Author: Andrew Vagin Date: Thu Oct 15 15:04:16 2015 +0400

[Devel] [PATCH RHEL7 COMMIT] ms/selftests: add memfd_create() + sealing tests

2015-10-15 Thread Konstantin Khorenko
The commit is pushed to "branch-rh7-3.10.0-229.7.2.vz7.8.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git after rh7-3.10.0-229.7.2.vz7.8.6 --> commit 2d68e19bd9105a3fe7006d8252ee516f97a9ade8 Author: Andrew Vagin Date: Thu Oct 15 15:04:18 2015 +0400

[Devel] [PATCH RHEL7 COMMIT] ms/mm: allow drivers to prevent new writable mappings

2015-10-15 Thread Konstantin Khorenko
The commit is pushed to "branch-rh7-3.10.0-229.7.2.vz7.8.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git after rh7-3.10.0-229.7.2.vz7.8.6 --> commit a60b63122e58834a4fd04b9be05311dd67801a07 Author: Andrew Vagin Date: Thu Oct 15 15:04:16 2015 +0400

Re: [Devel] [RFC] Fix get_exec_env() races

2015-10-15 Thread Kirill Tkhai
Vova remind me, we may sleep inside get_exec_env() section. So, it's yet better to use task work here. On 15.10.2015 13:02, Kirill Tkhai wrote: > Since we allow to attach a not current task to ve cgroup, there is the race > in the places where we use get_exec_env(). The task's ve may be changed

Re: [Devel] [PATCH RH7 1/2] device_cgroup: fake allowing all devices for docker inside VZCT

2015-10-15 Thread Konstantin Khorenko
Volodya, please review. -- Best regards, Konstantin Khorenko, Virtuozzo Linux Kernel Team On 10/13/2015 06:11 PM, Pavel Tikhomirov wrote: We need it for docker 1.7.+, please review. On 10/07/2015 11:51 AM, Pavel Tikhomirov wrote: Docker from 1.7.0 tries to add "a" to devices.allow for newly

[Devel] [PATCH RHEL7 COMMIT] ve: Strip unset options in ve.mount_opts

2015-10-15 Thread Konstantin Khorenko
The commit is pushed to "branch-rh7-3.10.0-229.7.2.vz7.8.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git after rh7-3.10.0-229.7.2.vz7.8.6 --> commit 5e85a8088c27b22a38d446530fab6904db6314a4 Author: Kirill Tkhai Date: Thu Oct 15 14:37:13 2015 +0400

Re: [Devel] [RFC] Fix get_exec_env() races

2015-10-15 Thread Pavel Emelyanov
> @@ -130,6 +131,34 @@ struct ve_struct { > #endif > }; > > +static inline struct ve_struct *get_exec_env(void) > +{ > + struct ve_struct *ve; > + > + if (++current->ve_attach_lock_depth > 1) > + return current->task_ve; > + > + rcu_read_lock(); > +again: > + ve =

[Devel] [PATCH RHEL7 COMMIT] ms/shm: add sealing API

2015-10-15 Thread Konstantin Khorenko
The commit is pushed to "branch-rh7-3.10.0-229.7.2.vz7.8.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git after rh7-3.10.0-229.7.2.vz7.8.6 --> commit 38bc7de2200c7f0aafacc2f30769787ca3c55308 Author: Andrew Vagin Date: Thu Oct 15 15:04:17 2015 +0400

[Devel] [PATCH RHEL7 COMMIT] ms/mm: introduce check_data_rlimit helper

2015-10-15 Thread Konstantin Khorenko
The commit is pushed to "branch-rh7-3.10.0-229.7.2.vz7.8.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git after rh7-3.10.0-229.7.2.vz7.8.6 --> commit a3ca20dacb7becb446fde9154abd51cbb0594674 Author: Andrew Vagin Date: Thu Oct 15 15:04:12 2015 +0400

[Devel] [PATCH RHEL7 COMMIT] ms/oom: add helpers for setting and clearing TIF_MEMDIE

2015-10-15 Thread Konstantin Khorenko
The commit is pushed to "branch-rh7-3.10.0-229.7.2.vz7.8.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git after rh7-3.10.0-229.7.2.vz7.8.6 --> commit 4860757ccf723defc3ba770ca3ad3f8c67c4ae20 Author: Vladimir Davydov Date: Thu Oct 15 17:47:34

[Devel] [PATCH RHEL7 COMMIT] ms/oom: thaw the OOM victim if it is frozen

2015-10-15 Thread Konstantin Khorenko
The commit is pushed to "branch-rh7-3.10.0-229.7.2.vz7.8.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git after rh7-3.10.0-229.7.2.vz7.8.6 --> commit 880e147721e60945828b460b86f36057e72603df Author: Vladimir Davydov Date: Thu Oct 15 17:47:35

[Devel] [PATCH RHEL7 COMMIT] ms/mm, oom: remove unnecessary exit_state check

2015-10-15 Thread Konstantin Khorenko
The commit is pushed to "branch-rh7-3.10.0-229.7.2.vz7.8.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git after rh7-3.10.0-229.7.2.vz7.8.6 --> commit d2dc55df7ee5b44dac752c1ff02e2ae5ce251935 Author: Vladimir Davydov Date: Thu Oct 15 17:47:32

[Devel] [PATCH RHEL7 COMMIT] oom: rework logic behind memory.oom_guarantee

2015-10-15 Thread Konstantin Khorenko
The commit is pushed to "branch-rh7-3.10.0-229.7.2.vz7.8.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git after rh7-3.10.0-229.7.2.vz7.8.6 --> commit acf9780b995d7cabcb227c5a3636635a365a1d7c Author: Vladimir Davydov Date: Thu Oct 15 17:53:02

[Devel] [PATCH RHEL7 COMMIT] memcg: add lock for protecting memcg->oom_notify list

2015-10-15 Thread Konstantin Khorenko
The commit is pushed to "branch-rh7-3.10.0-229.7.2.vz7.8.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git after rh7-3.10.0-229.7.2.vz7.8.6 --> commit f86c874c39188e9af50163092e161878a1067977 Author: Vladimir Davydov Date: Thu Oct 15 17:52:59

Re: [Devel] [RFC] Fix get_exec_env() races

2015-10-15 Thread Kirill Tkhai
On 15.10.2015 17:23, Pavel Emelyanov wrote: > On 10/15/2015 05:21 PM, Kirill Tkhai wrote: >> >> >> On 15.10.2015 14:15, Pavel Emelyanov wrote: >>> @@ -130,6 +131,34 @@ struct ve_struct { #endif }; +static inline struct ve_struct *get_exec_env(void) +{ +

[Devel] [PATCH RHEL7 COMMIT] ve/vtty: Make indices to match pcs6 scheme

2015-10-15 Thread Konstantin Khorenko
The commit is pushed to "branch-rh7-3.10.0-229.7.2.vz7.8.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git after rh7-3.10.0-229.7.2.vz7.8.8 --> commit 77f7c920ddb6426dfb580fff5146da73c6f7f7d3 Author: Cyrill Gorcunov Date: Thu Oct 15 20:04:49 2015

[Devel] [PATCH RHEL7 COMMIT] ve/net: introduce TAP accounting

2015-10-15 Thread Konstantin Khorenko
The commit is pushed to "branch-rh7-3.10.0-229.7.2.vz7.8.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git after rh7-3.10.0-229.7.2.vz7.8.6 --> commit b59e089eb2d2fdc939e54abb656cd5b7a2ad500e Author: Vladimir Sementsov-Ogievskiy Date: Thu Oct

[Devel] [PATCH RHEL7 COMMIT] config.OpenVZ: enable TAP accounting

2015-10-15 Thread Konstantin Khorenko
The commit is pushed to "branch-rh7-3.10.0-229.7.2.vz7.8.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git after rh7-3.10.0-229.7.2.vz7.8.6 --> commit 63d0e865e0fbcf122786ae211b1746e25e407657 Author: Konstantin Khorenko Date: Thu Oct 15 18:59:03

Re: [Devel] [PATCH rh7] vtty: Make indices to match pcs6 scheme

2015-10-15 Thread Vladimir Davydov
On Mon, Oct 05, 2015 at 12:54:26PM +0300, Cyrill Gorcunov wrote: > In pcs6 vttys are mapped into internal kernel representation in > nonobvious way. The /dev/console represent [maj:5,min:1], in > turn /dev/tty[0-...] are defined as [maj:4,min:0...], where > minor is bijective to symbol postfix of

[Devel] [PATCH RHEL7 COMMIT] ms/shm: add memfd_create() syscall: lost hunk

2015-10-15 Thread Konstantin Khorenko
The commit is pushed to "branch-rh7-3.10.0-229.7.2.vz7.8.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git after rh7-3.10.0-229.7.2.vz7.8.7 --> commit efd8ed12768cc7bee733d35a2c35393626707143 Author: Konstantin Khorenko Date: Thu Oct 15 19:39:42

[Devel] [PATCH RHEL7 COMMIT] memcg: add mem_cgroup_get/put helpers

2015-10-15 Thread Konstantin Khorenko
The commit is pushed to "branch-rh7-3.10.0-229.7.2.vz7.8.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git after rh7-3.10.0-229.7.2.vz7.8.6 --> commit 28d232fd4095c371daa0980f5fae9642a30780b1 Author: Vladimir Davydov Date: Thu Oct 15 17:52:58

Re: [Devel] [RFC] Fix get_exec_env() races

2015-10-15 Thread Pavel Emelyanov
On 10/15/2015 05:21 PM, Kirill Tkhai wrote: > > > On 15.10.2015 14:15, Pavel Emelyanov wrote: >> >>> @@ -130,6 +131,34 @@ struct ve_struct { >>> #endif >>> }; >>> >>> +static inline struct ve_struct *get_exec_env(void) >>> +{ >>> + struct ve_struct *ve; >>> + >>> + if

[Devel] [PATCH RHEL7 COMMIT] ms/oom: don't count on mm-less current process

2015-10-15 Thread Konstantin Khorenko
The commit is pushed to "branch-rh7-3.10.0-229.7.2.vz7.8.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git after rh7-3.10.0-229.7.2.vz7.8.6 --> commit 315f2cf7428d49d724775f01c545926c55b39a7e Author: Vladimir Davydov Date: Thu Oct 15 17:47:33

[Devel] [PATCH RHEL7 COMMIT] oom: pass points and overdraft to oom_kill_process

2015-10-15 Thread Konstantin Khorenko
The commit is pushed to "branch-rh7-3.10.0-229.7.2.vz7.8.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git after rh7-3.10.0-229.7.2.vz7.8.6 --> commit c67b670a0cde9ea89926108a26a651b9108e49c7 Author: Vladimir Davydov Date: Thu Oct 15 17:53:02

[Devel] [PATCH RHEL7 COMMIT] oom: drop OOM_SCAN_ABORT

2015-10-15 Thread Konstantin Khorenko
The commit is pushed to "branch-rh7-3.10.0-229.7.2.vz7.8.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git after rh7-3.10.0-229.7.2.vz7.8.6 --> commit 3bb5625c93235a4fd013b4307a1fd9cc9db4e6a8 Author: Vladimir Davydov Date: Thu Oct 15 17:53:01

[Devel] [PATCH RHEL7 COMMIT] oom: rework locking design

2015-10-15 Thread Konstantin Khorenko
The commit is pushed to "branch-rh7-3.10.0-229.7.2.vz7.8.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git after rh7-3.10.0-229.7.2.vz7.8.6 --> commit 6376b304e2690ab7e3868b19f4a3eb8f78ee869e Author: Vladimir Davydov Date: Thu Oct 15 17:53:00

[Devel] [PATCH RHEL7 COMMIT] oom: introduce oom timeout

2015-10-15 Thread Konstantin Khorenko
The commit is pushed to "branch-rh7-3.10.0-229.7.2.vz7.8.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git after rh7-3.10.0-229.7.2.vz7.8.6 --> commit 93e0a04b1eb4bcc4b996fe058af0c5a1c65b90c7 Author: Vladimir Davydov Date: Thu Oct 15 17:53:00

[Devel] [PATCH RHEL7 COMMIT] ms/mm: oom_kill: clean up victim marking and exiting interfaces

2015-10-15 Thread Konstantin Khorenko
The commit is pushed to "branch-rh7-3.10.0-229.7.2.vz7.8.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git after rh7-3.10.0-229.7.2.vz7.8.6 --> commit 495272394bfe50c2c5925a1ec2ffbebed25b7fea Author: Vladimir Davydov Date: Thu Oct 15 17:47:36

[Devel] [PATCH RHEL7 COMMIT] oom: resurrect berserker mode

2015-10-15 Thread Konstantin Khorenko
The commit is pushed to "branch-rh7-3.10.0-229.7.2.vz7.8.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git after rh7-3.10.0-229.7.2.vz7.8.6 --> commit e651315e4475767b41a7e028c6127b25c5754312 Author: Vladimir Davydov Date: Thu Oct 15 17:53:03

Re: [Devel] [RFC] Fix get_exec_env() races

2015-10-15 Thread Kirill Tkhai
On 15.10.2015 14:15, Pavel Emelyanov wrote: > >> @@ -130,6 +131,34 @@ struct ve_struct { >> #endif >> }; >> >> +static inline struct ve_struct *get_exec_env(void) >> +{ >> +struct ve_struct *ve; >> + >> +if (++current->ve_attach_lock_depth > 1) >> +return

[Devel] [PATCH RHEL7 COMMIT] ms/oom: make sure that TIF_MEMDIE is set under task_lock

2015-10-15 Thread Konstantin Khorenko
The commit is pushed to "branch-rh7-3.10.0-229.7.2.vz7.8.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git after rh7-3.10.0-229.7.2.vz7.8.6 --> commit 82d2c87b0e1ecd58487d26f479142a3517cffc44 Author: Vladimir Davydov Date: Thu Oct 15 17:47:34

Re: [Devel] [RFC] Fix get_exec_env() races

2015-10-15 Thread Vladimir Davydov
On Thu, Oct 15, 2015 at 05:21:04PM +0300, Kirill Tkhai wrote: > > > On 15.10.2015 14:15, Pavel Emelyanov wrote: > > > >> @@ -130,6 +131,34 @@ struct ve_struct { > >> #endif > >> }; > >> > >> +static inline struct ve_struct *get_exec_env(void) > >> +{ > >> + struct ve_struct *ve; > >> + >

[Devel] [NEW KERNEL] 3.10.0-229.7.2.vz7.8.8 (rhel7)

2015-10-15 Thread builder
Changelog: OpenVZ kernel rh7-3.10.0-229.7.2.vz7.8.8 * lost hunk brought for memfd_create() syscall port Generated changelog: * Thu Oct 15 2015 Konstantin Khorenko [3.10.0-229.7.2.vz7.8.8] - ms/shm: add memfd_create() syscall: lost hunk (Konstantin Khorenko)

Re: [Devel] [PATCH rh7] ve: Kill ve_list_head and ve_struct::ve_list

2015-10-15 Thread Vladimir Davydov
On Thu, Sep 24, 2015 at 06:11:26PM +0300, Kirill Tkhai wrote: > Since we use ve_idr layer to reserve a id for a ve, > and since a ve is linked there, using of ve_list_head > just for linking VEs becomes redundant. Nevertheless, iterating over a list is more convenient than over idr IMO. > >

Re: [Devel] [RFC] Fix get_exec_env() races

2015-10-15 Thread Kirill Tkhai
On 15.10.2015 17:44, Vladimir Davydov wrote: > On Thu, Oct 15, 2015 at 05:21:04PM +0300, Kirill Tkhai wrote: >> >> >> On 15.10.2015 14:15, Pavel Emelyanov wrote: >>> @@ -130,6 +131,34 @@ struct ve_struct { #endif }; +static inline struct ve_struct *get_exec_env(void)

Re: [Devel] [RFC] Fix get_exec_env() races

2015-10-15 Thread Kirill Tkhai
On 15.10.2015 19:49, Kirill Tkhai wrote: > > > On 15.10.2015 17:44, Vladimir Davydov wrote: >> On Thu, Oct 15, 2015 at 05:21:04PM +0300, Kirill Tkhai wrote: >>> >>> >>> On 15.10.2015 14:15, Pavel Emelyanov wrote: > @@ -130,6 +131,34 @@ struct ve_struct { > #endif > }; >