Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp4856577imw; Tue, 19 Jul 2022 14:52:50 -0700 (PDT) X-Google-Smtp-Source: AGRyM1srF6Mb1Zekkc+o+WCimMkrOpGnxEo5NZHAt0j6cPvehtYusGCb9oX4uUPWe2ne7E0JTyoV X-Received: by 2002:a65:60d5:0:b0:41a:625e:4c44 with SMTP id r21-20020a6560d5000000b0041a625e4c44mr757320pgv.364.1658267570430; Tue, 19 Jul 2022 14:52:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658267570; cv=none; d=google.com; s=arc-20160816; b=BDfkru0d56J8gNq+8Sxf/70t/ixQAbDQ5N6LZ2yJTwEhkABbcKZKDpXE3zaBIX/k8c xjQxu/fFJhuTDgdZHBCcNdsv6qp/6p8Ep6/+pjKPTPvv2vFMtvMFyLWN53u9/6eva+Zm crNOlZo+YYaObEYa5ce4WgFJEY/QeVbL9y0Knmgt0GvgVngFbZ0XZbCfzIUnajtxPPo6 XYck/y3uvWYTpHjjtIWVEsmKAEcS7hAuVdtprc8qMQQk/TFBx7x3XY9GDW4H7pmxfMNa lv7Y2llu1wplyB3v1SYxK3e0Hks3Qvc8pT0I9VmKeFsXwzMKBh8pqf9msf0S5icOkSJf O83g== 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-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=jjeVl4qs5CeEaP49NnnXRnAsqGSBkzv6YXSjxpIqWXs=; b=JL0Q3wlwcHhpMC4vGwEripzxJZm5iUjoVU9FUUtVJEEfCZMzvy2+ybS9RNpwVS6VJU pt/rSCSOW0XOumdUxbGDDefdRiFZI+qNW8uLEQeMpcyInMX0JJTRAZCGiF5JsC6efN09 CPOQXCWAop9HJTmNpsEqp7yN2l0vQyA0V9whDEijeUoBSd+WsiYlMG105h3G4OYcYlzo Qp5iBbzpLR4qeNjwPw7+pzHXM9ryANLlLorcj7ZH9k4HyY+1WzHuOvpoQbsjc1bWeQSd 3dzPpxiJlOiobwR5KAkqaxhuZZ5uT/Eo2vijg56uNgA6MZuqp9GYD245HiTItG+krbV8 PSrQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=WJW0EgnC; 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=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id rm12-20020a17090b3ecc00b001e0b16a6bb9si287088pjb.159.2022.07.19.14.52.36; Tue, 19 Jul 2022 14:52:50 -0700 (PDT) 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=@infradead.org header.s=bombadil.20210309 header.b=WJW0EgnC; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239216AbiGSVfQ (ORCPT + 99 others); Tue, 19 Jul 2022 17:35:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43716 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232712AbiGSVfO (ORCPT ); Tue, 19 Jul 2022 17:35:14 -0400 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 247C595B8; Tue, 19 Jul 2022 14:35:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Sender:In-Reply-To: Content-Transfer-Encoding:Content-Type:MIME-Version:References:Message-ID: Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description; bh=jjeVl4qs5CeEaP49NnnXRnAsqGSBkzv6YXSjxpIqWXs=; b=WJW0EgnCnITflTYYEBppwGUjM0 eqqcvxADvOynG0SnFLguO5WpJlMWCANotaPLnjeeSkRKYRawoaVFLb29TBbWvDj4uz+BHzFvq02a5 GFHSNlYWf66DF5PIey8y5iDChY56ySa8q961jnne7LxMTUh2ITZduhkRrsAVs/lBo+t04ZjORtIQj I2fxvLaw7V8q3emrv+Pd8q65Ud4UD7mXKs9yrGRr3RDIkP3PFSBaZAoWNyijLp517ygP2p41WPA+Z elFNNa+qdY0SEpDDPBWRUQHyOsVRg2e6/i1UUkj8uJq+0s9GezHr26tY/W1PWPl7oanL088zccC87 705VS7GA==; Received: from mcgrof by bombadil.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1oDurv-00DGKc-Oh; Tue, 19 Jul 2022 21:35:03 +0000 Date: Tue, 19 Jul 2022 14:35:03 -0700 From: Luis Chamberlain To: Matthew Wilcox Cc: "Fabio M. De Francesco" , Song Liu , Takashi Iwai , Adam Manzanares , Davidlohr Bueso , Ira Weiny , linux-modules@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] module: Replace kmap() with kmap_local_page() Message-ID: References: <20220718002645.28817-1-fmdefrancesco@gmail.com> <5303077.Sb9uPGUboI@opensuse> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: Sender: Luis Chamberlain X-Spam-Status: No, score=-2.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_LOW,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 Tue, Jul 19, 2022 at 09:23:49PM +0100, Matthew Wilcox wrote: > On Tue, Jul 19, 2022 at 11:19:24AM +0200, Fabio M. De Francesco wrote: > > On marted? 19 luglio 2022 00:19:50 CEST Luis Chamberlain wrote: > > > > Therefore, replace kmap() with kmap_local_page(). > > > > > > While this churn is going on everywhere I was wondering why not > > > go ahead and adopt kmap_local_folio() instead? > > > > I'm sorry but, due to my lack of knowledge and experience, I'm not sure to > > understand how kmap_local_folio() could help here. My fault. I'm going to > > make some research and ask for help from more experienced developers. > > I haven't made this suggestion to Fabio before for a few reasons. > > First, it makes his work harder. He not only has to understand the > implications of the kmap semantic changes but also the implications of > the folio change. > > Then, I'm not sure that I necessarily have enough infrastructure in place > for doing a folio conversion everywhere that he's doing a kmap/kmap_atomic > to kmap_local_page conversion. > > What makes it particularly tricky is that you can only kmap a single > page out of a folio at a time; there's no ability to kmap the entire > folio, no matter how large it is. I've looked at doing the conversion > for ext2 directories, and it's _tricky_. There's only one 'checked' > flag for the entire folio, but ext2_check_page() needs to take a mapped > page. So now we have to make a judgement call about whether to support > caching ext2 directories with large folios or whether to restrict them > to single-page folios. > > So yes, there's probably a second patch coming for maintainers to look > at that will convert the kmap_local_page() to kmap_local_folio(). > However, I think it's actually less of a burden for maintainers if > these two different conversions happen separately because there are very > different considerations to review. Also, there's no equivalent to kmap() > or kmap_atomic() for folios (deliberately), so the more conversions to > kmap_local_page() Fabio gets done, the easier it will be for a later > folio conversion. Makes sense, thanks for the feedback. I'll wrestle with ensuring the first step to kmap_local_page() doens't break things where I see them suggested first. Luis