lkml.org 
[lkml]   [2010]   [Jun]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v3 2/2] tmpfs: Make tmpfs scalable with percpu_counter for used blocks
On Fri, 18 Jun 2010 10:35:51 +0900 Minchan Kim <minchan.kim@gmail.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.



\
 
 \ /
  Last update: 2010-06-18 06:13    [W:0.082 / U:0.012 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site