From: Willem de Bruijn <willemdebruijn.kernel@gmail.com>
To: Al Viro <viro@zeniv.linux.org.uk>
Cc: Willem de Bruijn <willemdebruijn.kernel@gmail.com>,
Linux FS-devel Mailing List <linux-fsdevel@vger.kernel.org>,
linux-kernel <linux-kernel@vger.kernel.org>,
Andrew Morton <akpm@linux-foundation.org>,
Matthew Wilcox <willy@infradead.org>,
Arnd Bergmann <arnd@kernel.org>
Subject: Re: [PATCH 0/6] fs: deduplicate compat logic
Date: Mon, 11 Jan 2021 20:16:35 -0500 [thread overview]
Message-ID: <CA+FuTScKa+1WMLywzNTraCxkHAshix6v4Fxf3kh5ZENirsicMA@mail.gmail.com> (raw)
In-Reply-To: <20210112005823.GB3579531@ZenIV.linux.org.uk>
On Mon, Jan 11, 2021 at 7:58 PM Al Viro <viro@zeniv.linux.org.uk> wrote:
>
> On Mon, Jan 11, 2021 at 07:30:11PM -0500, Willem de Bruijn wrote:
> > From: Willem de Bruijn <willemb@google.com>
> >
> > Use in_compat_syscall() to differentiate compat handling exactly
> > where needed, including in nested function calls. Then remove
> > duplicated code in callers.
>
> IMO it's a bad idea. Use of in_compat_syscall() is hard to avoid
> in some cases, but let's not use it without a good reason. It
> makes the code harder to reason about.
In the specific cases of select, poll and epoll, this removes quite a
bit of duplicate code that may diverge over time. Indeed, for select
already has. Reduction of duplication may also make subsequent changes
more feasible. We discussed avoiding in epoll an unnecessary
ktime_get_ts64 in select_estimate_accuracy, which requires plumbing a
variable through these intermediate helpers.
I also personally find the code simpler to understand without the
various near duplicates. The change exposes their differences
more clearly. select is the best example of this.
The last two patches I added based on earlier comments. Perhaps
the helper in 5 adds more churn than it's worth.
prev parent reply other threads:[~2021-01-12 1:18 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-01-12 0:30 [PATCH 0/6] fs: deduplicate compat logic Willem de Bruijn
2021-01-12 0:30 ` [PATCH 1/6] selftests/filesystems: add initial select and poll selftest Willem de Bruijn
2021-01-12 0:30 ` [PATCH 2/6] select: deduplicate compat logic Willem de Bruijn
2021-01-12 0:30 ` [PATCH 3/6] ppoll: " Willem de Bruijn
2021-01-12 0:30 ` [PATCH 4/6] epoll: " Willem de Bruijn
2021-01-12 0:30 ` [PATCH 5/6] compat: add set_maybe_compat_user_sigmask helper Willem de Bruijn
2021-01-12 7:11 ` kernel test robot
2021-01-12 0:30 ` [PATCH 6/6] io_pgetevents: deduplicate compat logic Willem de Bruijn
2021-01-12 0:58 ` [PATCH 0/6] fs: " Al Viro
2021-01-12 1:16 ` Willem de Bruijn [this message]
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=CA+FuTScKa+1WMLywzNTraCxkHAshix6v4Fxf3kh5ZENirsicMA@mail.gmail.com \
--to=willemdebruijn.kernel@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=arnd@kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=viro@zeniv.linux.org.uk \
--cc=willy@infradead.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).