From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-14.8 required=3.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1, USER_IN_DEF_DKIM_WL autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 893E5C433ED for ; Fri, 23 Apr 2021 17:23:09 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 04D4A613D5 for ; Fri, 23 Apr 2021 17:23:08 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 04D4A613D5 Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id F37BF6B006C; Fri, 23 Apr 2021 13:23:07 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id EE83C6B0070; Fri, 23 Apr 2021 13:23:07 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D62DE6B0071; Fri, 23 Apr 2021 13:23:07 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0170.hostedemail.com [216.40.44.170]) by kanga.kvack.org (Postfix) with ESMTP id B94856B006C for ; Fri, 23 Apr 2021 13:23:07 -0400 (EDT) Received: from smtpin26.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 70D941801DBF8 for ; Fri, 23 Apr 2021 17:23:07 +0000 (UTC) X-FDA: 78064302414.26.1F619B5 Received: from mail-qt1-f178.google.com (mail-qt1-f178.google.com [209.85.160.178]) by imf28.hostedemail.com (Postfix) with ESMTP id 638EE200027D for ; Fri, 23 Apr 2021 17:23:09 +0000 (UTC) Received: by mail-qt1-f178.google.com with SMTP id u8so36859810qtq.12 for ; Fri, 23 Apr 2021 10:23:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:from:to:cc:subject:in-reply-to:message-id:references :user-agent:mime-version; bh=ab9jbz5NwGYvcWYzomBqApXdriLZ2AGZKnvLPb80Lgs=; b=M88KIhhroqFdlNzBy1544DT7e2YEw9mbFHH30yeXQKwC6vbDM49367m9NJ573gXn6b fpGXo25Pw/E/tc2chnR7vMVy/f9qg4dnq2G7z/dF5NMXj2Olh2noyPDUZshmLsuJopno 5cEWSCvSwG4hB5yoW+uHA5KqvLk4AfMXksRvqh408+FGsItAKv5soCRXegR7z+KPWgAK unaifcX3LCr+yWUoKVpWklJ8tEnm7w3FNNuywP9KYILwfAFvi9WH4fOSiS3UoSBjqieX 36JdZug4uP0YfUDRvdBAQWDzpPzRij6QBdNnMdOifYTRMKeSrJ1GxUYGZ+7q2E4fND9b rDwA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:in-reply-to:message-id :references:user-agent:mime-version; bh=ab9jbz5NwGYvcWYzomBqApXdriLZ2AGZKnvLPb80Lgs=; b=h8Z5OkdyHqiXN4zMvrbuIc3Iwrhk1CeL8a5sbSHOylikxnzmZyEE39YSJ+g5VBJ92N d6IUxe74op1EwMzVbKakyMUBQXBMiIsp+92suB2vU6OhMcI4m9E/74JSsFQghCFHmtTD 9Lwc2Tl89W7KmVXf5vPCMdVNyCLYw+xDKLTFyCEJdppPbyI1B+N1fcJVaTSykCyARGBF +JVPNID6UpjUwWnll3mIm68DcKy/gzNJ7RNzMGa1WYijr0eCYIkUCJcs62F2HkbIKeS3 13Byj7LV+GHq86JG3WoxcnEmfut3AmGLN427EV+G7yBnMdCflxSDKvFxMXB9+Vp3lhym W+mw== X-Gm-Message-State: AOAM532t7O/9JUKfM6mf6my6ctEaSCam+FRfN92RzmwipfoNgIILPa9l Tmz1i3efBOwlW2CPJPwmmTb2zg== X-Google-Smtp-Source: ABdhPJyhg1NrKyy0mU3GPwfYJ3XT8v6NxDjIEhss5wsoThfwS9AzwafUUTLOgb402Lq554oXOMhYBQ== X-Received: by 2002:ac8:6b49:: with SMTP id x9mr4808960qts.193.1619198586081; Fri, 23 Apr 2021 10:23:06 -0700 (PDT) Received: from eggly.attlocal.net (172-10-233-147.lightspeed.sntcca.sbcglobal.net. [172.10.233.147]) by smtp.gmail.com with ESMTPSA id x85sm4852092qkb.44.2021.04.23.10.23.04 (version=TLS1 cipher=ECDHE-ECDSA-AES128-SHA bits=128/128); Fri, 23 Apr 2021 10:23:05 -0700 (PDT) Date: Fri, 23 Apr 2021 10:22:51 -0700 (PDT) From: Hugh Dickins X-X-Sender: hugh@eggly.anvils To: Andrew Morton cc: Hugh Dickins , Matthew Wilcox , William Kucharski , Christoph Hellwig , Jan Kara , Dave Chinner , Johannes Weiner , "Kirill A. Shutemov" , Yang Shi , 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 In-Reply-To: <20210422160410.e9014b38b843d7a6ec06a9bb@linux-foundation.org> Message-ID: References: <20210422011631.GL3596236@casper.infradead.org> <20210422160410.e9014b38b843d7a6ec06a9bb@linux-foundation.org> User-Agent: Alpine 2.11 (LSU 23 2013-08-11) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: 638EE200027D X-Stat-Signature: pm97qecqj9iwiy4piob3kz4fgm56wfix Received-SPF: none (google.com>: No applicable sender policy available) receiver=imf28; identity=mailfrom; envelope-from=""; helo=mail-qt1-f178.google.com; client-ip=209.85.160.178 X-HE-DKIM-Result: pass/pass X-HE-Tag: 1619198589-972577 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Thu, 22 Apr 2021, Andrew Morton wrote: > On Thu, 22 Apr 2021 13:48:57 -0700 (PDT) Hugh Dickins 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