linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: nick <xerofoify@gmail.com>
To: Theodore Ts'o <tytso@mit.edu>, Jaegeuk Kim <jaegeuk@kernel.org>,
	linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org,
	linux-f2fs-devel@lists.sourceforge.net
Subject: Re: [PATCH 2/3] f2fs crypto: use bounce pages from mempool first
Date: Fri, 29 May 2015 15:10:34 -0400	[thread overview]
Message-ID: <5568B9AA.40900@gmail.com> (raw)
In-Reply-To: <20150528181811.GC18540@thunk.org>



On 2015-05-28 02:18 PM, Theodore Ts'o wrote:
> On Wed, May 27, 2015 at 02:18:54PM -0700, Jaegeuk Kim wrote:
>> The problem that I'd like to address here is to reduce the call counts of
>> allocating and freeing a number of pages in pairs.
>>
>> When I conduct xfstests/224 under 1GB DRAM, I've seen triggering several oom
>> killers, and in that moment, a huge number of inactive anonymous pages are
>> registered in the page cache. Not sure why those pages are not reclaimed
>> seamlessly though.
> 
> If the system is running 8 fio processes, each one writing 1 meg
> (BIO_MAX pages) at a time, one of the things that is going on is that
> we need to grab 256 4k paegs before the submitting the bio, and then
> if there are a large number of bio's queued, we can have potentially a
> very large number of pages allocated until the I/O has been completed.
> 
> So the problem is it's extremely difficult to determine ahead of time
> how many pages that need to be reserved in a mempool.  Simply
> increasing the number of in the mempool from 32 to 256 is no guarantee
> that it will be enough.  We originally only reserved 32 pages so that
> in the case of an extreme memory crunch, we could make at least some
> amount of forward progress.
> 
> I can imagine a number of different solutions (and these are not
> mutally exclusive):
> 
> 1) Try to dynamically adjust the number of pages we keep in the
> mempool so that we ramp up under I/O load and then gradually ramp down
> when the I/O pressure decreases.
> 
> 2) Keep track of how many temporary encryption outstanding bounce
> pages are outstanding, if we exceed some number, push back in
> writepages for encrypted inode.  That way we can make it be a tunable
> so that we don't end up using a huge number of pages, and can start
> throttling encrypted writeback even before we start getting allocation
> failures.
> 
> I'm currently leaning towards #2, myself.  I haven't tried doing some
> kernel performance measurements to see how much CPU time we're
> spending in alloc_page() and free_page() when under a very heavy
> memory load.  I assume you've done some measurements and this has been
> very heavy.  Can you give more details about how much CPU time is
> getting burned by alloc_page() and free_page()?  I had been assuming
> that if we're I/O bound, the extra CPU time to allocate and free the
> pages wouldn't be really onerous.  If you're seeing something
> different, I'd love to see some data (perf traces, etc.) to correct my
> impressions.
> 
> Cheers,
> 
> 					- Ted
> 
> ------------------------------------------------------------------------------
> _______________________________________________
> Linux-f2fs-devel mailing list
> Linux-f2fs-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
> 
Ted,
After reading this and thinking over the last few days you seem to have a correct idea
at least from my understanding of cache write back in the Linux kernel. However this
really needs to be bench marked first. I would be glad to benchmark this with perf 
on my system if you can give me the run down of what needs to be bench marked, I
have am a idea but would like a little more clarity.
Cheers,
Nick

------------------------------------------------------------------------------

  reply	other threads:[~2015-05-29 19:10 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-22  0:40 [PATCH 1/3] f2fs crypto: use per-inode tfm structure Jaegeuk Kim
2015-05-22  0:40 ` [PATCH 2/3] f2fs crypto: use bounce pages from mempool first Jaegeuk Kim
2015-05-25 10:00   ` [f2fs-dev] " Chao Yu
2015-05-27 19:09     ` Jaegeuk Kim
2015-05-29  2:45       ` Chao Yu
2015-05-25 19:55   ` Theodore Ts'o
2015-05-27 21:18     ` Jaegeuk Kim
2015-05-28 18:18       ` Theodore Ts'o
2015-05-29 19:10         ` nick [this message]
2015-05-28  4:21   ` [PATCH 2/3 v2] " Jaegeuk Kim
2015-05-22  0:40 ` [PATCH 3/3] f2fs crypto: preallocate BIO_MAX_PAGES for writeback Jaegeuk Kim

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5568B9AA.40900@gmail.com \
    --to=xerofoify@gmail.com \
    --cc=jaegeuk@kernel.org \
    --cc=linux-f2fs-devel@lists.sourceforge.net \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tytso@mit.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).