public inbox for linux-fsdevel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jingbo Xu <jefflexu@linux.alibaba.com>
To: Bernd Schubert <bernd@bsbernd.com>,
	Bernd Schubert <bschubert@ddn.com>,
	Miklos Szeredi <miklos@szeredi.hu>
Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org,
	Cheng Ding <cding@ddn.com>
Subject: Re: [PATCH] fuse: move page cache invalidation after AIO to workqueue
Date: Tue, 3 Mar 2026 22:16:43 +0800	[thread overview]
Message-ID: <2d59cd68-5013-4c4e-8088-7357cf314b14@linux.alibaba.com> (raw)
In-Reply-To: <e548152e-a831-4b5a-bc18-52fdb7dc1d7f@bsbernd.com>



On 3/3/26 8:37 PM, Bernd Schubert wrote:
> 
> 
> On 3/3/26 13:03, Jingbo Xu wrote:
>>
>>
>> On 3/3/26 6:23 PM, Bernd Schubert wrote:
>>> From: Cheng Ding <cding@ddn.com>
>>>
>>> Invalidating the page cache in fuse_aio_complete() causes deadlock.
>>> Call Trace:
>>>  <TASK>
>>>  __schedule+0x27c/0x6b0
>>>  schedule+0x33/0x110
>>>  io_schedule+0x46/0x80
>>>  folio_wait_bit_common+0x136/0x330
>>>  __folio_lock+0x17/0x30
>>>  invalidate_inode_pages2_range+0x1d2/0x4f0
>>>  fuse_aio_complete+0x258/0x270 [fuse]
>>>  fuse_aio_complete_req+0x87/0xd0 [fuse]
>>>  fuse_request_end+0x18e/0x200 [fuse]
>>>  fuse_uring_req_end+0x87/0xd0 [fuse]
>>>  fuse_uring_cmd+0x241/0xf20 [fuse]
>>>  io_uring_cmd+0x9f/0x140
>>>  io_issue_sqe+0x193/0x410
>>>  io_submit_sqes+0x128/0x3e0
>>>  __do_sys_io_uring_enter+0x2ea/0x490
>>>  __x64_sys_io_uring_enter+0x22/0x40
>>>
>>> Move the invalidate_inode_pages2_range() call to a workqueue worker
>>> to avoid this issue. This approach is similar to
>>> iomap_dio_bio_end_io().
>>>
>>> (Minor edit by Bernd to avoid a merge conflict in Miklos' for-next
>>> branch). The commit is based on that branch with the addition of
>>> https://lore.kernel.org/r/20260111073701.6071-1-jefflexu@linux.alibaba.com)
>>
>> I think it would be better to completely drop my previous patch and
>> rework on the bare ground, as the patch
>> (https://lore.kernel.org/r/20260111073701.6071-1-jefflexu@linux.alibaba.com)
>> is only in Miklos's branch, not merged to the master yet.
>>
>>
>> After reverting my previous patch, I think it would be cleaner by:
>>
>>
>> "The page cache invalidation for FOPEN_DIRECT_IO write in
>> fuse_direct_io() is moved to fuse_direct_write_iter() (with any progress
>> in write), to keep consistent with generic_file_direct_write().  This
>> covers the scenarios of both synchronous FOPEN_DIRECT_IO write
>> (regardless FUSE_ASYNC_DIO) and asynchronous FOPEN_DIRECT_IO write
>> without FUSE_ASYNC_DIO.
>>
>> After that, only asynchronous direct write (for both FOPEN_DIRECT_IO and
>> non-FOPEN_DIRECT_IO) with FUSE_ASYNC_DIO is left."
> 
> I think your suggestion moves into this direction
> 
> https://lore.kernel.org/all/20230918150313.3845114-1-bschubert@ddn.com/
> 

Yes it's similar in some way, but it's still simple enough as the short
term fix.

-- 
Thanks,
Jingbo


  reply	other threads:[~2026-03-03 14:16 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-03 10:23 [PATCH] fuse: move page cache invalidation after AIO to workqueue Bernd Schubert
2026-03-03 12:03 ` Jingbo Xu
2026-03-03 12:37   ` Bernd Schubert
2026-03-03 14:16     ` Jingbo Xu [this message]
     [not found]   ` <LV1PR19MB88707F9B1F84DC199F99BF25BC7AA@LV1PR19MB8870.namprd19.prod.outlook.com>
2026-03-06 14:10     ` Jingbo Xu

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=2d59cd68-5013-4c4e-8088-7357cf314b14@linux.alibaba.com \
    --to=jefflexu@linux.alibaba.com \
    --cc=bernd@bsbernd.com \
    --cc=bschubert@ddn.com \
    --cc=cding@ddn.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --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