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 7A9ABC433B4 for ; Fri, 23 Apr 2021 17:23:10 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 4F1DF613D7 for ; Fri, 23 Apr 2021 17:23:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231760AbhDWRXp (ORCPT ); Fri, 23 Apr 2021 13:23:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52830 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229957AbhDWRXo (ORCPT ); Fri, 23 Apr 2021 13:23:44 -0400 Received: from mail-qt1-x82c.google.com (mail-qt1-x82c.google.com [IPv6:2607:f8b0:4864:20::82c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1E86BC06174A for ; Fri, 23 Apr 2021 10:23:07 -0700 (PDT) Received: by mail-qt1-x82c.google.com with SMTP id d6so18660209qtx.13 for ; Fri, 23 Apr 2021 10:23:07 -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=smgxwjdimXaHrarqDuWGNRMbbyfwEnajTXNGeKTBuFoVXM76Rmm/B+SJ1ckjSTM7tk X5cY1nDUPYnPYjYIcKFooIRE+T1w5Di/q+NQFMbknmsNET3NzeOBMmMKC8EzDnasd8XT viStaHfzmF4Mpaf6IDy3u1PhI/1tXtp/z2m+/7c+7BeO9UbLwgRqnSWvqkUz9vr1280c 3oSnxoma4lBntDxnZlXZ+TSdduVdHNYLYpO4UDg3uauuxuTJ5DE32tWzlleZkP/OuEDw VQPVwYgs2BOoGZO7casB3AKCk8gcVUgfJTrRk0dT/X2hUCAxmrQalrX7idJN9g1I/Z1s jd8w== X-Gm-Message-State: AOAM532Bov2hkymoYIg2KWYQnNVR1UDWTCx1x/ylF3h9ZzigMffpgjFM 1Mu3z/KwdWa/rGHNBK828utQyw== 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 Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org 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