lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Thu, 17 Apr 2008 10:49:06 -0700
From:	"Paul Menage" <menage@...gle.com>
To:	"Oleg Nesterov" <oleg@...sign.ru>
Cc:	"Balbir Singh" <balbir@...ux.vnet.ibm.com>,
	"Andrew Morton" <akpm@...ux-foundation.org>, serue@...ibm.com,
	penberg@...helsinki.fi, linux-kernel@...r.kernel.org
Subject: Re: [Fwd: [-mm] Add an owner to the mm_struct (v9)]

On Thu, Apr 17, 2008 at 9:19 AM, Oleg Nesterov <oleg@...sign.ru> wrote:
> On 04/17, Paul Menage wrote:
>  >
>  > On Thu, Apr 17, 2008 at 4:30 AM, Oleg Nesterov <oleg@...sign.ru> wrote:
>  > >  >
>  > >  > I had this loop earlier (inspired from zap_threads()), is this loop more
>  > >  > efficient than what we have?
>  > >
>  > >  All sub-threads have the same ->mm. Once we see that c->mm != mm, we don't
>  > >  need to waste CPU iterating over the all other threads in the thread group.
>  >
>  > Technically they don't have to have the same mm, right? You can use
>  > CLONE_THREAD without CLONE_VM when creating a new subthread.
>
>  No, no, this is not possible/allowed.
>
>  Please look at copy_process, CLONE_THREAD requires CLONE_SIGHAND,
>  CLONE_SIGHAND needs CLONE_VM.

Ah, OK. I saw that CLONE_THREAD -> CLONE_SIGHAND but I didn't notice
the second implication. That would mean that your optimization is
valid, good.

>
>  Let's suppose 2 task belongs to different cgroups, but share ->mm,
>
>
>  > - swap cgroup - when swapping from an mm, find a task whose swap
>  > cgroup we can charge the swap page to
>
>  now we will charge the somewhat "random" cgroup. The one to which
>  the result of the last "find the next suitable owner" belongs.

Correct. (Although if two tasks are sharing an mm, charging either of
them seems perfectly fair, as long as we charge exactly one of them
and remember who we charged).

>
>  This looks a bit strange to me... but OK, as I said, I don't know
>  what cgroup is, please ignore me ;)

A control group is just a way of grouping tasks together for the
purposes of resource control, isolation, etc.

Yes, weird things can potentially happen in this case - if the user
sets up situations like this, hopefully they know what they're doing.
The important thing is that these weird setups not crash.

Paul
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ