From: Thomas Gleixner <email@example.com>
To: Matthew Wilcox <firstname.lastname@example.org>,
"Darrick J. Wong" <email@example.com>
Cc: firstname.lastname@example.org, email@example.com,
Alexander Viro <firstname.lastname@example.org>,
Christoph Hellwig <email@example.com>
Subject: Re: [PATCH 1/2] iomap: Use kmap_local_page instead of kmap_atomic
Date: Tue, 10 Aug 2021 23:18:38 +0200 [thread overview]
Message-ID: <87mtppov69.ffs@tglx> (raw)
On Thu, Aug 05 2021 at 19:24, Matthew Wilcox wrote:
> On Thu, Aug 05, 2021 at 10:39:03AM -0700, Darrick J. Wong wrote:
>> Though now that I think about it: Why does iomap_write_actor still use
>> copy_page_from_iter_atomic? Can that be converted to use regular
>> copy_page_from_iter, which at least sometimes uses kmap_local_page?
> I suspect copy_page_from_iter_atomic() should be converted to use
> kmap_local_page(), but I don't know. generic_perform_write() uses
> the _atomic() version, so I'm not doing anything different without
> understanding more than I currently do.
Most of the kmap_atomic() usage can be converted to kmap_local(). There
are only a few usage sites which really depend on the implicit preempt
The reason why we cannot convert the bulk blindly is that quite some
usage sites have user memory access nested inside. As kmap_atomic()
disables preemption and page faults the error handling needs to be
outside the atomic section, i.e. after kunmap_atomic(). So if you
convert that you have to get rid of that extra error handling and just
use the regular user memory accessors.
IIRC there are a few places which really want pagefaults disabled, but
those do not necessarily need preemption disabled. So they need to be
converted to kmap_local(); pagefault_disable(); err = dostuff(); ....
Hope that helps.
prev parent reply other threads:[~2021-08-10 21:18 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-08-03 19:31 [PATCH 1/2] iomap: Use kmap_local_page instead of kmap_atomic Matthew Wilcox (Oracle)
2021-08-03 19:31 ` [PATCH 2/2] iomap: Add another assertion to inline data handling Matthew Wilcox (Oracle)
2021-08-05 17:31 ` Darrick J. Wong
2021-08-05 17:31 ` [PATCH 1/2] iomap: Use kmap_local_page instead of kmap_atomic Darrick J. Wong
2021-08-05 17:39 ` Darrick J. Wong
2021-08-05 18:24 ` Matthew Wilcox
2021-08-10 21:18 ` Thomas Gleixner [this message]
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:
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
* 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).