All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: Hugh Dickins <hughd@google.com>
Cc: Johannes Weiner <hannes@cmpxchg.org>,
	Michal Hocko <mhocko@suse.cz>,
	linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH mmotm/next] mm: memcontrol: rewrite charge API: fix shmem_unuse
Date: Mon, 30 Jun 2014 17:34:28 -0700	[thread overview]
Message-ID: <20140630173428.5ebeed18.akpm@linux-foundation.org> (raw)
In-Reply-To: <alpine.LSU.2.11.1406301658430.4898@eggly.anvils>

On Mon, 30 Jun 2014 17:10:54 -0700 (PDT) Hugh Dickins <hughd@google.com> wrote:

> On Mon, 30 Jun 2014, Andrew Morton wrote:
> > On Mon, 30 Jun 2014 15:48:39 -0700 (PDT) Hugh Dickins <hughd@google.com> wrote:
> > > -		return 0;
> > > +		return -EAGAIN;
> > 
> > Maybe it's time to document the shmem_unuse_inode() return values.
> 
> Oh dear.  I had hoped they would look after themselves.  This one is a
> private matter between shmem_unuse_inode and its one caller, just below.

Well, readers of shmem_unuse_inode() won't know that unless we tell them.


> > > +	if (error) {
> > > +		if (error != -ENOMEM)
> > > +			error = 0;
> > >  		mem_cgroup_cancel_charge(page, memcg);
> > >  	} else
> > >  		mem_cgroup_commit_charge(page, memcg, true);
> > 
> > If I'm reading this correctly, shmem_unuse() can now return -EAGAIN and
> > that can get all the way back to userspace.  `man 2 swapoff' doesn't
> > know this...
> 
> if (error) {
> 	if (error != -ENOMEM)
> 		error = 0;
> ...
> 	return error;
> 
> So the only values returned from shmem_unuse_inode() to its caller
> try_to_unuse() are 0 and -ENOMEM.  Those may get passed back to the
> user, but -EAGAIN was just an internal shmem.c detail.

OK.

--
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>

WARNING: multiple messages have this Message-ID (diff)
From: Andrew Morton <akpm@linux-foundation.org>
To: Hugh Dickins <hughd@google.com>
Cc: Johannes Weiner <hannes@cmpxchg.org>,
	Michal Hocko <mhocko@suse.cz>,
	linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH mmotm/next] mm: memcontrol: rewrite charge API: fix shmem_unuse
Date: Mon, 30 Jun 2014 17:34:28 -0700	[thread overview]
Message-ID: <20140630173428.5ebeed18.akpm@linux-foundation.org> (raw)
In-Reply-To: <alpine.LSU.2.11.1406301658430.4898@eggly.anvils>

On Mon, 30 Jun 2014 17:10:54 -0700 (PDT) Hugh Dickins <hughd@google.com> wrote:

> On Mon, 30 Jun 2014, Andrew Morton wrote:
> > On Mon, 30 Jun 2014 15:48:39 -0700 (PDT) Hugh Dickins <hughd@google.com> wrote:
> > > -		return 0;
> > > +		return -EAGAIN;
> > 
> > Maybe it's time to document the shmem_unuse_inode() return values.
> 
> Oh dear.  I had hoped they would look after themselves.  This one is a
> private matter between shmem_unuse_inode and its one caller, just below.

Well, readers of shmem_unuse_inode() won't know that unless we tell them.


> > > +	if (error) {
> > > +		if (error != -ENOMEM)
> > > +			error = 0;
> > >  		mem_cgroup_cancel_charge(page, memcg);
> > >  	} else
> > >  		mem_cgroup_commit_charge(page, memcg, true);
> > 
> > If I'm reading this correctly, shmem_unuse() can now return -EAGAIN and
> > that can get all the way back to userspace.  `man 2 swapoff' doesn't
> > know this...
> 
> if (error) {
> 	if (error != -ENOMEM)
> 		error = 0;
> ...
> 	return error;
> 
> So the only values returned from shmem_unuse_inode() to its caller
> try_to_unuse() are 0 and -ENOMEM.  Those may get passed back to the
> user, but -EAGAIN was just an internal shmem.c detail.

OK.

  reply	other threads:[~2014-07-01  0:34 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-30 22:48 [PATCH mmotm/next] mm: memcontrol: rewrite charge API: fix shmem_unuse Hugh Dickins
2014-06-30 22:48 ` Hugh Dickins
2014-06-30 23:02 ` Andrew Morton
2014-06-30 23:02   ` Andrew Morton
2014-07-01  0:10   ` Hugh Dickins
2014-07-01  0:10     ` Hugh Dickins
2014-07-01  0:34     ` Andrew Morton [this message]
2014-07-01  0:34       ` Andrew Morton
2014-07-01  1:06       ` Hugh Dickins
2014-07-01  1:06         ` Hugh Dickins
2014-07-02 22:37 ` Johannes Weiner
2014-07-02 22:37   ` Johannes Weiner

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=20140630173428.5ebeed18.akpm@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=hannes@cmpxchg.org \
    --cc=hughd@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mhocko@suse.cz \
    /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.