All of lore.kernel.org
 help / color / mirror / Atom feed
From: Hugh Dickins <hughd@google.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Hugh Dickins <hughd@google.com>,
	Matthew Wilcox <willy@infradead.org>,
	William Kucharski <william.kucharski@oracle.com>,
	Christoph Hellwig <hch@lst.de>, Jan Kara <jack@suse.cz>,
	Dave Chinner <dchinner@redhat.com>,
	Johannes Weiner <hannes@cmpxchg.org>,
	"Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>,
	Yang Shi <yang.shi@linux.alibaba.com>,
	linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-mm@kvack.org
Subject: Re: [PATCH v2 2/2] mm/filemap: fix mapping_seek_hole_data on THP & 32-bit
Date: Fri, 23 Apr 2021 10:22:51 -0700 (PDT)	[thread overview]
Message-ID: <alpine.LSU.2.11.2104231009520.18646@eggly.anvils> (raw)
In-Reply-To: <20210422160410.e9014b38b843d7a6ec06a9bb@linux-foundation.org>

On Thu, 22 Apr 2021, Andrew Morton wrote:
> On Thu, 22 Apr 2021 13:48:57 -0700 (PDT) Hugh Dickins <hughd@google.com> wrote:
> 
> > Andrew, I'd have just sent a -fix.patch to remove the unnecessary u64s,
> > but need to reword the commit message: so please replace yesterday's
> > mm-filemap-fix-mapping_seek_hole_data-on-thp-32-bit.patch
> > by this one - thanks.
> 
> Actually, I routinely update the base patch's changelog when queueing a -fix.

And thank you for that, but if there's time, I think we would still
prefer the final commit message to include corrections where Matthew
enlightened me (that "sign-extension" claim came from my confusion):

-u64 casts added to stop unfortunate sign-extension when shifting (and
-let's use shifts throughout, rather than mixed with * and /).
-
-Use round_up() when advancing pos, to stop assuming that pos was already
-THP-aligned when advancing it by THP-size.  (But I believe this use of
-round_up() assumes that any THP must be THP-aligned: true while tmpfs
-enforces that alignment, and is the only fs with FS_THP_SUPPORT; but might
-need to be generalized in the future?  If I try to generalize it right
-now, I'm sure to get it wrong!)
+u64 cast to stop losing bits when converting unsigned long to loff_t
+(and let's use shifts throughout, rather than mixed with * and /).
+
+Use round_up() when advancing pos, to stop assuming that pos was
+already THP-aligned when advancing it by THP-size.  (This use of
+round_up() assumes that any THP has THP-aligned index: true at present
+and true going forward, but could be recoded to avoid the assumption.)

Thanks,
Hugh

  reply	other threads:[~2021-04-23 17:23 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-22  0:35 [PATCH 0/2] mm/filemap: fix 5.12-rc regressions Hugh Dickins
2021-04-22  0:35 ` Hugh Dickins
2021-04-22  0:37 ` [PATCH 1/2] mm/filemap: fix find_lock_entries hang on 32-bit THP Hugh Dickins
2021-04-22  0:37   ` Hugh Dickins
2021-04-22  1:06   ` Matthew Wilcox
2021-04-22  0:39 ` [PATCH 2/2] mm/filemap: fix mapping_seek_hole_data on THP & 32-bit Hugh Dickins
2021-04-22  0:39   ` Hugh Dickins
2021-04-22  1:16   ` Matthew Wilcox
2021-04-22  5:55     ` Hugh Dickins
2021-04-22  5:55       ` Hugh Dickins
2021-04-22 20:46       ` Hugh Dickins
2021-04-22 20:46         ` Hugh Dickins
2021-04-22 20:48         ` [PATCH v2 " Hugh Dickins
2021-04-22 20:48           ` Hugh Dickins
2021-04-22 23:04           ` Andrew Morton
2021-04-23 17:22             ` Hugh Dickins [this message]
2021-04-23 17:22               ` Hugh Dickins
2021-04-23 19:29               ` Andrew Morton
2021-04-23 20:08                 ` Hugh Dickins
2021-04-23 20:08                   ` Hugh Dickins

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=alpine.LSU.2.11.2104231009520.18646@eggly.anvils \
    --to=hughd@google.com \
    --cc=akpm@linux-foundation.org \
    --cc=dchinner@redhat.com \
    --cc=hannes@cmpxchg.org \
    --cc=hch@lst.de \
    --cc=jack@suse.cz \
    --cc=kirill.shutemov@linux.intel.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=william.kucharski@oracle.com \
    --cc=willy@infradead.org \
    --cc=yang.shi@linux.alibaba.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.