Re: [PATCH mmotm/next] mm: memcontrol: rewrite charge API: fix shmem_unuse

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, 30 Jun 2014, Andrew Morton wrote:
> On Mon, 30 Jun 2014 15:48:39 -0700 (PDT) Hugh Dickins <hughd@xxxxxxxxxx> 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.

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

Hugh

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




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]