Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1333572
| From | Dave Chinner <david@fromorbit.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH] kernel: fs: drop_caches: add dds drop_caches_count |
| Date | 2016-02-14 22:20 +0100 |
| Message-ID | <r2cff-8he-7@gated-at.bofh.it> (permalink) |
| References | <r1sm5-3kI-1@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On Fri, Feb 12, 2016 at 12:14:39PM -0800, Daniel Walker wrote: > From: Khalid Mughal <khalidm@cisco.com> > > Currently there is no way to figure out the droppable pagecache size > from the meminfo output. The MemFree size can shrink during normal > system operation, when some of the memory pages get cached and is > reflected in "Cached" field. Similarly for file operations some of > the buffer memory gets cached and it is reflected in "Buffers" field. > The kernel automatically reclaims all this cached & buffered memory, > when it is needed elsewhere on the system. The only way to manually > reclaim this memory is by writing 1 to /proc/sys/vm/drop_caches. But > this can have performance impact. Since it discards cached objects, > it may cause high CPU & I/O utilization to recreate the dropped > objects during heavy system load. > This patch computes the droppable pagecache count, using same > algorithm as "vm/drop_caches". It is non-destructive and does not > drop any pages. Therefore it does not have any impact on system > performance. The computation does not include the size of > reclaimable slab. Why, exactly, do you need this? You've described what the patch does (i.e. redundant, because we can read the code), and described that the kernel already accounts this reclaimable memory elsewhere and you can already read that and infer the amount of reclaimable memory from it. So why isn't that accounting sufficient? As to the code, I think it is a horrible hack - the calculation does not come for free. Forcing iteration all the inodes in the inode cache is not something we should allow users to do - what's to stop someone just doing this 100 times in parallel and DOSing the machine? Or what happens when someone does 'grep "" /proc/sys/vm/*" to see what all the VM settings are on a machine with a couple of TB of page cache spread across a couple of hundred million cached inodes? It a) takes a long time, b) adds sustained load to an already contended lock (sb->s_inode_list_lock), and c) isn't configuration information. Cheers, Dave. -- Dave Chinner david@fromorbit.com
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH] kernel: fs: drop_caches: add dds drop_caches_count Daniel Walker <danielwa@cisco.com> - 2016-02-12 21:20 +0100
Re: [PATCH] kernel: fs: drop_caches: add dds drop_caches_count Dave Chinner <david@fromorbit.com> - 2016-02-14 22:20 +0100
Re: [PATCH] kernel: fs: drop_caches: add dds drop_caches_count Daniel Walker <danielwa@cisco.com> - 2016-02-15 19:30 +0100
Re: [PATCH] kernel: fs: drop_caches: add dds drop_caches_count Dave Chinner <david@fromorbit.com> - 2016-02-16 00:10 +0100
Re: [PATCH] kernel: fs: drop_caches: add dds drop_caches_count Daniel Walker <danielwa@cisco.com> - 2016-02-16 01:00 +0100
Re: [PATCH] kernel: fs: drop_caches: add dds drop_caches_count Theodore Ts'o <tytso@mit.edu> - 2016-02-16 01:50 +0100
Re: [PATCH] kernel: fs: drop_caches: add dds drop_caches_count "Nag Avadhanam (nag)" <nag@cisco.com> - 2016-02-16 04:10 +0100
Re: [PATCH] kernel: fs: drop_caches: add dds drop_caches_count Dave Chinner <david@fromorbit.com> - 2016-02-16 06:40 +0100
Re: [PATCH] kernel: fs: drop_caches: add dds drop_caches_count Nag Avadhanam <nag@cisco.com> - 2016-02-16 08:20 +0100
Re: [PATCH] kernel: fs: drop_caches: add dds drop_caches_count Dave Chinner <david@fromorbit.com> - 2016-02-16 09:40 +0100
Re: [PATCH] kernel: fs: drop_caches: add dds drop_caches_count Vladimir Davydov <vdavydov@virtuozzo.com> - 2016-02-16 09:50 +0100
Re: [PATCH] kernel: fs: drop_caches: add dds drop_caches_count Nag Avadhanam <nag@cisco.com> - 2016-02-16 19:40 +0100
Re: [PATCH] kernel: fs: drop_caches: add dds drop_caches_count Dave Chinner <david@fromorbit.com> - 2016-02-16 06:30 +0100
Re: [PATCH] kernel: fs: drop_caches: add dds drop_caches_count Nag Avadhanam <nag@cisco.com> - 2016-02-16 07:10 +0100
Re: [PATCH] kernel: fs: drop_caches: add dds drop_caches_count Dave Chinner <david@fromorbit.com> - 2016-02-16 09:30 +0100
Re: [PATCH] kernel: fs: drop_caches: add dds drop_caches_count Rik van Riel <riel@redhat.com> - 2016-02-16 17:20 +0100
csiph-web