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:	Mon, 11 Jul 2011 13:41:31 -0700
From:	Paul Menage <menage@...gle.com>
To:	Frederic Weisbecker <fweisbec@...il.com>
Cc:	LKML <linux-kernel@...r.kernel.org>,
	Andrew Morton <akpm@...ux-foundation.org>,
	Li Zefan <lizf@...fujitsu.com>,
	Johannes Weiner <hannes@...xchg.org>,
	Aditya Kali <adityakali@...gle.com>
Subject: Re: [PATCH 2/7] cgroups: New resource counter inheritance API

On Mon, Jul 11, 2011 at 7:15 AM, Frederic Weisbecker <fweisbec@...il.com> wrote:
> Provide an API to inherit a counter value from a parent.
> This can be useful to implement cgroup.clone_children on
> a resource counter.
>
> Still the resources of the children are limited by those
> of the parent, so this is only to provide a default setting
> behaviour when clone_children is set.
>
> Signed-off-by: Frederic Weisbecker <fweisbec@...il.com>

Can't this be just:

void res_counter_inherit(struct res_counter *counter, int member) {
  struct res_counter *parent;
  parent = counter->parent;
  if (parent)
    res_counter_write_u64(counter, member,
res_counter_read_u64(parent, member));
}

This is just used at cgroup creation time, right? So the performance
impact of an extra cli/sti shouldn't matter.

Also, looking at the code res_counter_read_u64() appears to not do any
locking. I don't recall why I added it like that, but it probably
ought to do at least an atomic64_read().

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