From: yangyun <yangyun50@huawei.com>
To: <miklos@szeredi.hu>
Cc: <josef@toxicpanda.com>, <linux-fsdevel@vger.kernel.org>,
<linux-kernel@vger.kernel.org>, <lixiaokeng@huawei.com>,
<yangyun50@huawei.com>
Subject: Re: [PATCH v2 1/2] fuse: move fuse_forget_link allocation inside fuse_queue_forget()
Date: Tue, 27 Aug 2024 17:34:26 +0800 [thread overview]
Message-ID: <20240827093426.3397154-1-yangyun50@huawei.com> (raw)
In-Reply-To: <CAJfpegsFvE-oSaYqNWBAdiXnBYWGAp+Lc8cjL3BWs9bd+O_c2A@mail.gmail.com>
On Mon, Aug 26, 2024 at 09:24:22PM +0200, Miklos Szeredi wrote:
> On Sat, 24 Aug 2024 at 11:26, yangyun <yangyun50@huawei.com> wrote:
> >
> > The `struct fuse_forget_link` is allocated outside `fuse_queue_forget()`
> > before this patch. This requires the allocation in advance. In some
> > cases, this struct is not needed but allocated, which contributes to
> > memory usage and performance degradation. Besides, this messes up the
> > code to some extent. So move the `fuse_forget_link` allocation inside
> > fuse_queue_forget with __GFP_NOFAIL.
> >
> > `fuse_force_forget()` is used by `readdirplus` before this patch for
> > the reason that we do not know how many 'fuse_forget_link' structures
> > will be allocated in advance when error happens. After this patch, this
> > function is not needed any more and can be removed. By this way, all
> > FUSE_FORGET requests are sent by using `fuse_queue_forget()` function as
> > e.g. virtiofs handles them differently from regular requests.
>
> The patch is nice and clean. However, I'm a bit worried about the
> inode eviction path, which can be triggered from memory reclaim.
> Allocating a small structure shouldn't be an issue, yet I feel that
> the old way of preallocating it on inode creation should be better.
>
> What do you think?
You are right. Since flag __GFP_NOFAIL would block the system, especailly in
the memeory reclaim situaion. The preallocating of this struct is necessary
because it will be exactly used in the inode eviction path. I'm sorry for not
considering the risk of __GFP_NOFAIL seriously as a beginner.
Thanks for the reminder. Update soon.
>
> Thanks,
> Miklos
next prev parent reply other threads:[~2024-08-27 9:35 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-24 9:25 [PATCH v2 0/2] fuse: add no forget support yangyun
2024-08-24 9:25 ` [PATCH v2 1/2] fuse: move fuse_forget_link allocation inside fuse_queue_forget() yangyun
2024-08-26 19:24 ` Miklos Szeredi
2024-08-27 9:34 ` yangyun [this message]
2024-08-24 9:25 ` [PATCH v2 2/2] fuse: add support for no forget requests yangyun
2024-08-30 9:19 ` [PATCH v2 0/2] fuse: add no forget support Miklos Szeredi
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=20240827093426.3397154-1-yangyun50@huawei.com \
--to=yangyun50@huawei.com \
--cc=josef@toxicpanda.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lixiaokeng@huawei.com \
--cc=miklos@szeredi.hu \
/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
all inboxes | Powered by JetHome®