public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Fabio M. De Francesco" <fmdefrancesco@gmail.com>
To: Al Viro <viro@zeniv.linux.org.uk>
Cc: Evgeniy Dushistov <dushistov@mail.ru>,
	Christian Brauner <brauner@kernel.org>,
	linux-kernel@vger.kernel.org, bpf@vger.kernel.org,
	"Venkataramanan, Anirudh" <anirudh.venkataramanan@intel.com>,
	Ira Weiny <ira.weiny@intel.com>
Subject: Re: [RESEND PATCH v4] fs/ufs: Replace kmap() with kmap_local_page()
Date: Sat, 26 Nov 2022 15:12:16 +0100	[thread overview]
Message-ID: <2188828.irdbgypaU6@suse> (raw)
In-Reply-To: <Y4FG0O7VWTTng5yh@ZenIV>

On venerdì 25 novembre 2022 23:50:56 CET Al Viro wrote:
> On Fri, Nov 25, 2022 at 10:17:28PM +0000, Al Viro wrote:
> > The bottom line:
> > 	* teach your ufs_put_page() to accept any address within the page
> > 	* flip the ways you return page and address in ufs_get_page()
> > 	* use offset_in_page(addr) instead of these addr - 
page_address(page)
> > 
> > and you'll get a much smaller patch, with a lot less noise in it.
> > What's more, offset_in_page() part can be carved out into a separate
> > commit - it's valid on its own, and it makes both halves easier to
> > follow.
> > 
> > AFAICS, similar observations apply in your sysvfs patch; the point about
> > calling conventions for ufs_get_page() definitely applies there, and
> > stronger than for ufs - those casts are eye-watering...
> 
> As the matter of fact, I'd probably split it into 3 steps:
> 	1) switch the calling conventions of ufs_get_page() - callers follow
> it with something like kaddr = page_address(page); and that change makes
> sense on its own.  Isolated and easy to follow.
> 	2) offset_in_page() changes.  Again, separate, stands on its own and
> is easy to follow.
> 	3) kmap_local() switch itself - pass address to ufs_put_page(), etc.
> Considerably smaller and less cluttered than your current variant.

Al, thanks for taking the time to answer in such detail although I can believe 
that, to spot the mistakes in my patch and then write your email, it probably 
took you 10 minutes or so :-)

Instead I had to read two or three times to make sense of it all. I will do my 
best to first rewrite these kmap_local_page() conversions in fs/ufs by 
separating the work into three patches, as you recommended.

I'm pretty sure that the next attempt won't be applicable yet, because I might 
not fully understand your suggestions or I might not be able to implement them 
correctly. I'm afraid I addressed something that, as it stands, is a little 
beyond my knowledge and experience, so I hope you'll want to chime in and 
comment on the next version as well.

When the changes to fs/ufs will be done I will also rewrite the patch for fs/
sysv which (as you pointed out) needs to be worked out according to the same 
requirements.

I am sincerely grateful to you also because it seemed to me that I would never 
get any feedback regarding these two old patches.

Regards,

Fabio




  reply	other threads:[~2022-11-26 14:12 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-16 16:38 [RESEND PATCH v4] fs/ufs: Replace kmap() with kmap_local_page() Fabio M. De Francesco
2022-11-25 16:19 ` Fabio M. De Francesco
2022-11-25 22:17 ` Al Viro
2022-11-25 22:50   ` Al Viro
2022-11-26 14:12     ` Fabio M. De Francesco [this message]
2022-11-27 16:15       ` Al Viro
2022-11-28 23:06         ` Fabio M. De Francesco

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=2188828.irdbgypaU6@suse \
    --to=fmdefrancesco@gmail.com \
    --cc=anirudh.venkataramanan@intel.com \
    --cc=bpf@vger.kernel.org \
    --cc=brauner@kernel.org \
    --cc=dushistov@mail.ru \
    --cc=ira.weiny@intel.com \
    --cc=linux-kernel@vger.kernel.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