Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp12248493rwb; Sat, 26 Nov 2022 06:29:06 -0800 (PST) X-Google-Smtp-Source: AA0mqf7tLNlw/s6DJ0NDovvw5+zXRDdUNvpo/uV2x6NjhMpMLm1khkgGJv5/jdiilB6lSHne3o3R X-Received: by 2002:a17:906:4351:b0:78d:513d:f447 with SMTP id z17-20020a170906435100b0078d513df447mr23603408ejm.708.1669472946495; Sat, 26 Nov 2022 06:29:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669472946; cv=none; d=google.com; s=arc-20160816; b=1HjUwwt7M0jf4PkqYCCtoeBF9FmA2u0RCNuFOh1zBrfb19q2KwgJgiUTYRdQC4+40n /XwYvQ+KhVZGKB3LJjI/oxGaAGEqGUDuRSUgbDztePRIhtvI/AMMBee9P6TsD/1Rxifp GGe7ci+gHTho00UvjCzFKlYig1cjLp3vUQeZUjuHU2MNudIc41nO5995AcLwoF+xg3Kt tRTu3gznDz5qyXTgcGHTRcRhQ7VuYwJTI20+AUjmUUSBEvgLNSKAPiqvQrnlBo+p4ft+ b80VTFvX0otpsyYIBfQk4SmltldqmKnT8Nk3TRkyRIuvPKpoEHHkxxMAx9SRam9R0gar vSNw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=/mP0jQyPa/WPgNondQxR1aqMRo1/9+aoHgpIr8lZMUQ=; b=WfSsw8Cn7ljiGL/S6gH/qvAcsjjo9zAgc0ebofBXNllK8Xu5Ctx3EVfhBbA2SHtKAT Fah+C5LFYqhRMtz59H84cu4r6j3mc4AD5KTHa7p6kvtYavWhYRpY0948A5H+crJ50qdE poNG3CBbJEy5owqc0UXpHhL0nucp86ifpaZRs3odGeDNyShHHMCQu5q/0024Sw9YoJeC R2B8sFeiPUtPtSgzR/zXJnFf+YEM03fYafCt7q5Zv15mrWmAGD808AUuObwLot6qbnFq 4QfdAl9pCTCe+QM76/ifkH95XupeE7JlLG0EcwBIQ3iGuThh+eOLXlK7Xp2ZVxbLwQ19 UMmA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=aOVOmwdA; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ho16-20020a1709070e9000b0078dffe01cbesi7340083ejc.4.2022.11.26.06.28.43; Sat, 26 Nov 2022 06:29:06 -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=@gmail.com header.s=20210112 header.b=aOVOmwdA; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229487AbiKZOMX (ORCPT + 84 others); Sat, 26 Nov 2022 09:12:23 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54970 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229436AbiKZOMV (ORCPT ); Sat, 26 Nov 2022 09:12:21 -0500 Received: from mail-wm1-x332.google.com (mail-wm1-x332.google.com [IPv6:2a00:1450:4864:20::332]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 442AB1FF8C; Sat, 26 Nov 2022 06:12:20 -0800 (PST) Received: by mail-wm1-x332.google.com with SMTP id p16so5392556wmc.3; Sat, 26 Nov 2022 06:12:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=/mP0jQyPa/WPgNondQxR1aqMRo1/9+aoHgpIr8lZMUQ=; b=aOVOmwdAaahnaO9K5sR9Os63SuX6ti1w8q3DaF02HA/Q/eifGYgkU8s0g4MzJL0i9B YLt3rD+8e5eVR/hxqucOk8bld3quh9E2IzYpErFZINgztMWyROTBzGfP79IUTcjs5Db9 S7zZbaSFxOkxblLZDNtmmdrdih5hKKsekN+q0i+JJU71B2jdfXBzi996VkDLoOVmr+eD 4zeTGdEZbrcYzGCA4mHrLS1PXmGDrTIpmooS5Hq6m1y7LLVDSQqiOp0GBSE9s2+fOJlP eOTl/RE4VQJBo/3IcckwAnQsjKaOrTMyEwGud7HJ9NMMB14tmRUX0AEYynKonUIfI1kk pNJw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=/mP0jQyPa/WPgNondQxR1aqMRo1/9+aoHgpIr8lZMUQ=; b=16t8VzFTtFdz/g+o+/jZUgSkfXvgQuEYw3SxnM0Vdc24pznjCBQHcX3j7C3P97xkhY 3XSoEX3UsbMLJFBNNWyeCj9+sENy7HChl5GgilmgzQ6U+SyjiUQWsK85L8Ll9q1lHshd zakBRbPshaUy+1XlpzHIPcrzTjJJ/Wglztl5TivJzFHk0a2mZva5qaIJRekcE4t18dCu /U+43b/Iop0qemMQysoa4uIWTBMChARffJR17sSoIxj2TooT9kkDKkT1sYUrU6ry4l6j +XJruQzxpIZ8/eOM7+1l06JQiBZHm5FK/5nHn+v6oi2DPYofS9SMe0P0SjxSCj3k71Xc GYvw== X-Gm-Message-State: ANoB5pkO8oXNpaX6lrtAMcRO4qkMa2YW1XraDeudkw/fGHs4sdy/oPMC kwrma/x7d9Xo+8HJAmhqXPw= X-Received: by 2002:a05:600c:1c9d:b0:3cf:69ec:9628 with SMTP id k29-20020a05600c1c9d00b003cf69ec9628mr32055376wms.79.1669471938450; Sat, 26 Nov 2022 06:12:18 -0800 (PST) Received: from suse.localnet (host-79-55-110-244.retail.telecomitalia.it. [79.55.110.244]) by smtp.gmail.com with ESMTPSA id j29-20020a5d6e5d000000b00241b371d73esm6188413wrz.77.2022.11.26.06.12.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 26 Nov 2022 06:12:17 -0800 (PST) From: "Fabio M. De Francesco" To: Al Viro 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() Date: Sat, 26 Nov 2022 15:12:16 +0100 Message-ID: <2188828.irdbgypaU6@suse> In-Reply-To: References: <20221016163855.8173-1-fmdefrancesco@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="iso-8859-1" X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS 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 venerd=EC 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 -=20 page_address(page) > >=20 > > 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. > >=20 > > 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... >=20 > 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 =3D 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 beli= eve=20 that, to spot the mistakes in my patch and then write your email, it probab= ly=20 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=20 best to first rewrite these kmap_local_page() conversions in fs/ufs by=20 separating the work into three patches, as you recommended. I'm pretty sure that the next attempt won't be applicable yet, because I mi= ght=20 not fully understand your suggestions or I might not be able to implement t= hem=20 correctly. I'm afraid I addressed something that, as it stands, is a little= =20 beyond my knowledge and experience, so I hope you'll want to chime in and=20 comment on the next version as well. When the changes to fs/ufs will be done I will also rewrite the patch for f= s/ sysv which (as you pointed out) needs to be worked out according to the sam= e=20 requirements. I am sincerely grateful to you also because it seemed to me that I would ne= ver=20 get any feedback regarding these two old patches. Regards, =46abio