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:	Sun, 20 Jun 2010 23:28:42 +0900
From:	Minchan Kim <minchan.kim@...il.com>
To:	Andrew Morton <akpm@...ux-foundation.org>
Cc:	Tim Chen <tim.c.chen@...ux.intel.com>,
	linux-kernel@...r.kernel.org, Andi Kleen <ak@...ux.intel.com>,
	Hugh Dickins <hughd@...gle.com>, yanmin.zhang@...el.com
Subject: Re: [PATCH v3 2/2] tmpfs: Make tmpfs scalable with percpu_counter
 for used blocks

On Thu, Jun 17, 2010 at 09:08:59PM -0700, Andrew Morton wrote:
> On Fri, 18 Jun 2010 10:35:51 +0900 Minchan Kim <minchan.kim@...il.com> wrote:
> 
> > > __struct shmem_sb_info {
> > > __ __ __ __unsigned long max_blocks; __ /* How many blocks are allowed */
> > > - __ __ __ unsigned long free_blocks; __/* How many are left for allocation */
> > > + __ __ __ struct percpu_counter used_blocks; __/* How many are allocated */
> > 
> > Just a nitpick.
> > Why do you change free_blocks and used_blocks?
> > I think we can use free_blocks following as.
> > 
> > ex)
> > if (percpu_counter_compare(&sbinfo->free_blocks, 0))
> 
> See previous lengthy discussion ;)
> 
> If we count free_blocks then we need to alter the value of free_blocks
> in remount_fs, and reinitialising distributed counters on-the-fly is
> ugly.
> 
> I suppose we could have done it by doing a large add or sub in
> remount_fs, and keeping track of the exact value of free_blocks
> elsewhere in the superblock, but it's far simpler this way.
> 

Thanks, Andrew. I found your comment in previous mail thread. 
Tim, Please add below Andrew's comment in description. 

It would make reviewer happy in future.

--
Andrew's comment
" It a bit buggy - using percpu_counter_init() against an
already-initialised percpu_counter() is leaky.  I suspect that's
happening in remount_fs.

A better approach would be to remove free_blocks altogether and add a
new `percpu_counter used_blocks;' which simply counts how many blocks
are presently in use.  Such a thing would then never need to be
reinitialised."


-- 
Kind regards,
Minchan Kim
--
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