mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: 杨轶甄 <yangyizhen3198@phytium.com.cn>
To: "Christian Brauner" <brauner@kernel.org>
Cc: "Jens Axboe" <axboe@kernel.dk>,
	"Alexander Viro" <viro@zeniv.linux.org.uk>,
	"Jan Kara" <jack@suse.cz>,
	linux-block@vger.kernel.org, linux-fsdevel@vger.kernel.org,
	linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: Re: Re: [RFC PATCH 0/1] block: long udev open waits during cache teardown
Date: Thu, 26 Nov 2026 19:04:50 +0800 (GMT+08:00)	[thread overview]
Message-ID: <4effe3b8.6085.1a217879319.Coremail.yangyizhen3198@phytium.com.cn> (raw)
In-Reply-To: <20261120-hassliebe-arena-kaufvertrag-3ac58fd0483a@brauner>

Hi Christian,

> If that still reproduces on mainline it's a question
> about the bdev release locking.

I reproduced the long udev open wait on upstream Linux v6.6 and on
Linux v7.0.14. On both kernels, udev blocked while trying to open the
device as mkfs.ntfs was closing it after a full format.

Thanks for pointing out the impact on other openers. I agree that a
udev probe closing its own file could trigger writeback and evict
cache that another opener is still using. I'll drop the __fput()
proposal.

I'd like to understand the locking requirements in the block device
last-close path. In particular, why does kill_bdev() need to complete
while open_mutex is held? What state and ordering requirements does
the lock protect during this cleanup?

I'm asking because the device mapping can still contain a large
amount of clean page cache after the early sync. In my tests on the
vendor 6.6 kernel, about 805 GiB remained at final teardown, and
the truncate took roughly seven minutes while udev was waiting.
Could the release path be changed to reduce the time open_mutex is
held while preserving those requirements?

> And mkfs can just fsync() and POSIX_FADV_DONTNEED the device itself
> before it closes it.

I've submitted a patch to the ntfs-3g project that calls fsync()
and then posix_fadvise(..., POSIX_FADV_DONTNEED) in userspace
before closing the device.

Thanks,
Ethan

信息安全声明:本邮件包含信息归发件人所在组织所有,发件人所在组织对该邮件拥有所有权利。请接收者注意保密,未经发件人书面许可,不得向任何第三方组织和个人透露本邮件所含信息。
Information Security Notice: The information contained in this mail is solely property of the sender's organization.This mail communication is confidential.Recipients named above are obligated to maintain secrecy and are not permitted to disclose the contents of this communication to others.

  reply	other threads:[~2026-11-26 11:04 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-17 10:51 Ethan
2026-11-17 10:51 ` [RFC PATCH 1/1] block: reclaim cache before block file close notification Ethan
2026-11-20 12:40 ` [RFC PATCH 0/1] block: long udev open waits during cache teardown Christian Brauner
2026-11-26 11:04   ` 杨轶甄 [this message]
2026-11-26 11:36     ` Jan Kara

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=4effe3b8.6085.1a217879319.Coremail.yangyizhen3198@phytium.com.cn \
    --to=yangyizhen3198@phytium.com.cn \
    --cc=axboe@kernel.dk \
    --cc=brauner@kernel.org \
    --cc=jack@suse.cz \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=viro@zeniv.linux.org.uk \
    /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®