linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Anton Altaparmakov <aia21@cam.ac.uk>
To: Miklos Szeredi <miklos@szeredi.hu>
Cc: akpm@osdl.org, torvalds@osdl.org, linux-fsdevel@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/11] FUSE - core
Date: Fri, 14 Jan 2005 14:14:12 +0000 (GMT)	[thread overview]
Message-ID: <Pine.LNX.4.60.0501141409500.18572@hermes-1.csi.cam.ac.uk> (raw)
In-Reply-To: <E1CpS73-0001kC-00@dorka.pomaz.szeredi.hu>

On Fri, 14 Jan 2005, Miklos Szeredi wrote:
> > > +static struct inode *fuse_alloc_inode(struct super_block *sb)
> > > +{
> > > +	struct inode *inode;
> > > +	struct fuse_inode *fi;
> > > +
> > > +	inode = kmem_cache_alloc(fuse_inode_cachep, SLAB_KERNEL);
> > 
> > This should probably be SLAB_NOFS as FUSE is a file system so you don't 
> > want allocations to go off submitting i/o to your file system.  Much 
> > better to be safe and always use the _NOFS versions in you kernel fs code.
> 
> Well, I don't think it matters in this case, since inode allocation is
> not part of processing I/O, so no deadlock is possible.  See also
> alloc_inode() in fs/inode.c which also uses SLAB_KERNEL.

That may well be possible.  I prefer to take a more cautious approach and 
only use _NOFS variants within NTFS, whether it is strictly necessary or 
not.  That way I never need to worry as to whether a deadlock is or isn't 
possible.  The problem simply goes away...

[snip]
> In actual fact the whole GFP_NOFS argument doesn't apply to FUSE
> _at_all_, since dirty pages are never allowed.  Which is because
> userspace can't easily be taught about GFP_NOFS allocations, and
> otherwise could deadlock on page writeback.

Yes, I remember the thread about the deadlock on page writeback.

I prefer the _NOFS regardless (and others will probably disagree) because 
it also means that if a machine is seriously running out of memory the fs 
will give up with -ENOMEM much more readily with _NOFS rather than 
increasing the memory pressure even further.  As I said, others probably 
disagree with me...

Best regards,

	Anton
-- 
Anton Altaparmakov <aia21 at cam.ac.uk> (replace at with @)
Unix Support, Computing Service, University of Cambridge, CB2 3QH, UK
Linux NTFS maintainer / IRC: #ntfs on irc.freenode.net
WWW: http://linux-ntfs.sf.net/ & http://www-stu.christs.cam.ac.uk/~aia21/

  reply	other threads:[~2005-01-14 14:14 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-01-11 16:25 [PATCH 2/11] FUSE - core Miklos Szeredi
2005-01-12 22:36 ` Andrew Morton
2005-01-13  5:31   ` Miklos Szeredi
2005-01-14 13:55 ` Anton Altaparmakov
2005-01-14 14:07   ` Miklos Szeredi
2005-01-14 14:14     ` Anton Altaparmakov [this message]
2005-01-14 14:32       ` Miklos Szeredi
  -- strict thread matches above, loose matches on Subject: below --
2005-01-10 18:58 Miklos Szeredi
2005-01-10 21:40 ` Mike Waychison
2005-01-10 22:28   ` Miklos Szeredi
2005-02-14 22:43 ` Faraz Ahmed

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=Pine.LNX.4.60.0501141409500.18572@hermes-1.csi.cam.ac.uk \
    --to=aia21@cam.ac.uk \
    --cc=akpm@osdl.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=miklos@szeredi.hu \
    --cc=torvalds@osdl.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 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).