Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp11383849rwb; Fri, 25 Nov 2022 15:05:51 -0800 (PST) X-Google-Smtp-Source: AA0mqf4kfD8FuvdlRg3YB8x+vA9MfLsZmeeFOd2GTZHqiM2nJg88laBO8yD66LzfTvtJG51NsIJH X-Received: by 2002:a63:dc45:0:b0:44e:46f9:7eeb with SMTP id f5-20020a63dc45000000b0044e46f97eebmr18424122pgj.3.1669417550907; Fri, 25 Nov 2022 15:05:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669417550; cv=none; d=google.com; s=arc-20160816; b=ivKN6WAmdvzPXTikRopMPphFE+9DA/3Z7St2Jgrf4xqiTbZktMy1XBSWur3vyi1490 4J49pr3RzN/JgEEsvfEkq68rarRR/O23uJQCG1XOnIpEDUNi7MVDyhcRr6klkAJ3yrax gwsraB0ZVsUqY9wUrivy8dnz22mSMrKh4bzHbKnjsSNOTw+qS0l+bXAwzr0kTLtwpUbV tVzIU2LvLNck58Tjg3Qz3g/AYxIMLSaS4ZFsBFN1lb8k4O5D+MAmRLz23lswH4Dc7h71 Kva4YbYulPvmlrKx/evaHwTB0fP8jOBfL2SOBCLclgCoByjyn60qPSpWSU7FIn+EaFRx V84Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=81lCKAZfIlY/BgnFBjKaFCh7oQXF+X/zYFNJffYZSsw=; b=si5bPwoK1Jesg+b3LnHD9kPvi1iA1JXnHeCZOJm+OqfXD1xgznOgPZLX4frt3wWMpH +t/CfxxPJRR8VgeDpPkYHvkmysjmMAwxAGR1Zy1XtpClonXAA9gpGVvbq4NoL7de9btf YypkEZvGZvFR3FhBDtgWnJT1bPRoY+eaOWPH1Kv+B5UnIvNFLA0bo+52erE/zEifXB27 5ZFH3hg49X/yQYVBTlSIwjctGFVQIxfkHhOiQUQS8J5ubaOtlQCYXqvYijPDir/KaD/3 QDH8dZkiIkq3pQv0VDHxbPXGvZk+ETjpIPfs7HpynJ8jbjJCYIeKwI5cqiESjGICj27v az6w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.org.uk header.s=zeniv-20220401 header.b=WUTOVfX7; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=zeniv.linux.org.uk Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k14-20020a170902c40e00b0018931c1059fsi4371789plk.422.2022.11.25.15.05.38; Fri, 25 Nov 2022 15:05:50 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.org.uk header.s=zeniv-20220401 header.b=WUTOVfX7; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=zeniv.linux.org.uk Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229878AbiKYWvG (ORCPT + 85 others); Fri, 25 Nov 2022 17:51:06 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57616 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229758AbiKYWvF (ORCPT ); Fri, 25 Nov 2022 17:51:05 -0500 Received: from zeniv.linux.org.uk (zeniv.linux.org.uk [IPv6:2a03:a000:7:0:5054:ff:fe1c:15ff]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4614830F7F; Fri, 25 Nov 2022 14:51:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=linux.org.uk; s=zeniv-20220401; h=Sender:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=81lCKAZfIlY/BgnFBjKaFCh7oQXF+X/zYFNJffYZSsw=; b=WUTOVfX70qzaJkm2+WD+hQdwkF dsXopo5Y5ReWxn0hZipDXOOlweqZFVgQGRADfw2a5OsXwwK0TNufItchqr8l7Dg4W91JI8qutl1sF Vr7F4OeFOy9DAWlIitBajMmQAvuj5IylXS432S6sPsJJrlMVHuFWtCYC/mHc59d1+xbqrMNAg9tmb SRf0BKNh1h+CtUZntp5jn1PqAfHRaLPrMXR1gMEPBTO7Sv9LeAt1FWr3f7SOm3UlmP5uLqt42Lb+B Aq8Olt4xqitdGOgYgle0mcujkUqiMk/qd+ZZwV4rL8Pt87J45LlenXm/Q7WNRWFITtky3sDkW+69Y VFt7TtJg==; Received: from viro by zeniv.linux.org.uk with local (Exim 4.96 #2 (Red Hat Linux)) id 1oyhX6-006li7-1U; Fri, 25 Nov 2022 22:50:56 +0000 Date: Fri, 25 Nov 2022 22:50:56 +0000 From: Al Viro To: "Fabio M. De Francesco" Cc: Evgeniy Dushistov , Christian Brauner , linux-kernel@vger.kernel.org, bpf@vger.kernel.org, "Venkataramanan, Anirudh" , Ira Weiny Subject: Re: [RESEND PATCH v4] fs/ufs: Replace kmap() with kmap_local_page() Message-ID: References: <20221016163855.8173-1-fmdefrancesco@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: Al Viro X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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.