All of lore.kernel.org
 help / color / mirror / Atom feed
From: Theodore Ts'o <tytso@mit.edu>
To: NeilBrown <neilb@suse.com>
Cc: Michal Hocko <mhocko@kernel.org>,
	willy@bombadil.infradead.org, willy@infradead.org,
	lsf-pc@lists.linux-foundation.org, linux-fsdevel@vger.kernel.org,
	linux-mm@kvack.org
Subject: Re: [ATTEND] many topics
Date: Sat, 21 Jan 2017 08:16:44 -0500	[thread overview]
Message-ID: <20170121131644.zupuk44p5jyzu5c5@thunk.org> (raw)
In-Reply-To: <878tq5ff0i.fsf@notabene.neil.brown.name>

On Sat, Jan 21, 2017 at 11:11:41AM +1100, NeilBrown wrote:
> What are the benefits of GFP_TEMPORARY?  Presumably it doesn't guarantee
> success any more than GFP_KERNEL does, but maybe it is slightly less
> likely to fail, and somewhat less likely to block for a long time??  But
> without some sort of promise, I wonder why anyone would use the
> flag.  Is there a promise?  Or is it just "you can be nice to the MM
> layer by setting this flag sometimes". ???

My understanding is that the idea is to allow short-term use cases not
to be mixed with long-term use cases --- in the Java world, to declare
that a particular object will never be promoted from the "nursury"
arena to the "tenured" arena, so that we don't end up with a situation
where a page is used 90% for temporary objects, and 10% for a tenured
object, such that later on we have a page which is 90% unused.

Many of the existing users may in fact be for things like a temporary
bounce buffer for I/O, where declaring this to the mm system could
lead to less fragmented pages, but which would violate your proposed
contract:

>   GFP_TEMPORARY should be used when the memory allocated will either be
>   freed, or will be placed in a reclaimable cache, before the process
>   which allocated it enters an TASK_INTERRUPTIBLE sleep or returns to
>   user-space.  It allows access to memory which is usually reserved for
>   XXX and so can be expected to succeed more quickly during times of
>   high memory pressure.

I think what you are suggested is something very different, where you
are thinking that for *very* short-term usage perhaps we could have a
pool of memory, perhaps the same as the GFP_ATOMIC memory, or at least
similar in mechanism, where such usage could be handy.

Is there enough use cases where this would be useful?  In the local
disk backed file system world, I doubt it.  But maybe in the (for
example) NFS world, such a use would in fact be common enough that it
would be useful.

I'd suggest doing this though as a new category, perhaps
GFP_REALLY_SHORT_TERM, or GFP_MAYFLY for short.  :-)

		       	  	     	 	 - Ted

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

  reply	other threads:[~2017-01-21 13:16 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-18  5:49 [ATTEND] many topics Matthew Wilcox
2017-01-18 10:13 ` [Lsf-pc] " Jan Kara
2017-01-18 11:26   ` willy
2017-01-18 13:32 ` Michal Hocko
2017-01-19 11:05   ` willy
2017-01-19 11:33     ` Michal Hocko
2017-01-19 11:52       ` willy
2017-01-19 12:11         ` Michal Hocko
2017-01-21  0:11           ` NeilBrown
2017-01-21 13:16             ` Theodore Ts'o [this message]
2017-01-22  4:45               ` NeilBrown
2017-01-23  6:05                 ` Matthew Wilcox
2017-01-23  6:30                   ` NeilBrown
2017-01-23  6:35                     ` Matthew Wilcox
2017-01-23 17:09                   ` Theodore Ts'o
2017-01-23 19:34                     ` NeilBrown
2017-01-25 14:36                       ` Vlastimil Babka
2017-01-25 20:36                         ` Matthew Wilcox
2017-01-25 21:15                           ` Vlastimil Babka
2017-01-25 23:19                         ` NeilBrown
2017-01-26  8:56                           ` Michal Hocko
2017-01-26 21:20                             ` NeilBrown
2017-01-27 13:12                               ` Michal Hocko

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=20170121131644.zupuk44p5jyzu5c5@thunk.org \
    --to=tytso@mit.edu \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=lsf-pc@lists.linux-foundation.org \
    --cc=mhocko@kernel.org \
    --cc=neilb@suse.com \
    --cc=willy@bombadil.infradead.org \
    --cc=willy@infradead.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.