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]
Message-Id: <20080521212408.6f535259.akpm@linux-foundation.org>
Date:	Wed, 21 May 2008 21:24:08 -0700
From:	Andrew Morton <akpm@...ux-foundation.org>
To:	Balbir Singh <balbir@...ux.vnet.ibm.com>
Cc:	linux-mm@...ck.org, Sudhir Kumar <skumar@...ux.vnet.ibm.com>,
	YAMAMOTO Takashi <yamamoto@...inux.co.jp>,
	Paul Menage <menage@...gle.com>, lizf@...fujitsu.com,
	linux-kernel@...r.kernel.org, Pavel Emelianov <xemul@...nvz.org>,
	KAMEZAWA Hiroyuki <kamezawa.hiroyu@...fujitsu.com>
Subject: Re: [-mm][PATCH 4/4] Add memrlimit controller accounting and
 control (v5)

On Wed, 21 May 2008 21:00:12 +0530 Balbir Singh <balbir@...ux.vnet.ibm.com> wrote:

> 
> This patch adds support for accounting and control of virtual address space
> limits. The accounting is done via the rlimit_cgroup_(un)charge_as functions.
> The core of the accounting takes place during fork time in copy_process(),
> may_expand_vm(), remove_vma_list() and exit_mmap(). 
> 
> Changelog v5->v4
> 
> Move specific hooks in code to insert_vm_struct
> Use mmap_sem to protect mm->owner from changing and mm->owner from
> changing cgroups.
> 
> ...
>
> + * brk(), sbrk()), stack expansion, mremap(), etc - called with
> + * mmap_sem held.
> + * decreasing - called with mmap_sem held.
> + * This callback is called with mmap_sem held

It's good to document the locking prerequisites but for rwsems, one
should specify whether it must be held for reading or for writing.

Of course, down_write() is a superset of down_read(), so if it's "held
for reading" then either mode-of-holding is OK.  But it's best to spell
all that out.

--
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