linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Miklos Szeredi <miklos@szeredi.hu>
To: aia21@cam.ac.uk
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 15:07:41 +0100	[thread overview]
Message-ID: <E1CpS73-0001kC-00@dorka.pomaz.szeredi.hu> (raw)
In-Reply-To: <Pine.LNX.4.60.0501141351130.18572@hermes-1.csi.cam.ac.uk> (message from Anton Altaparmakov on Fri, 14 Jan 2005 13:55:46 +0000 (GMT))

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

> > +static struct fuse_conn *new_conn(void)
> > +{
> > +	struct fuse_conn *fc;
> > +
> > +	fc = kmalloc(sizeof(*fc), GFP_KERNEL);
> 
> Same comment as before:  GFP_NOFS is safer.

Same reason as above.

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.

Thanks,
Miklos

  reply	other threads:[~2005-01-14 14:08 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 [this message]
2005-01-14 14:14     ` Anton Altaparmakov
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=E1CpS73-0001kC-00@dorka.pomaz.szeredi.hu \
    --to=miklos@szeredi.hu \
    --cc=aia21@cam.ac.uk \
    --cc=akpm@osdl.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --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).