Received: by 2002:a05:7412:3784:b0:e2:908c:2ebd with SMTP id jk4csp1866691rdb; Tue, 3 Oct 2023 03:41:37 -0700 (PDT) X-Google-Smtp-Source: AGHT+IF7PiOo5iQ0wIOp8Ilkuuj7cp5hE2P9VdvTDlwkcUtVQ6TjSxksq2zA+Eq/OXve7A5DpbSf X-Received: by 2002:a05:6870:239e:b0:1bf:e2a6:b287 with SMTP id e30-20020a056870239e00b001bfe2a6b287mr16814433oap.0.1696329696891; Tue, 03 Oct 2023 03:41:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696329696; cv=none; d=google.com; s=arc-20160816; b=wtXko9OoQDeA7u5hdEUKW/5lm/UTr2zg4Nxk3hVU37syvjj0zCAxaqSmYF+ONLnDst yjU9FAdMBx9W4EyNWTliNXqHZDLQdpuBdiWyj5beW/mEabCML3bvWC6DBHo3A+g3jkay sEV9XB9gau9UV9pQG8OOK65N2mD5I9m2KhxxmDOjIHsPeG4r7wDJZgG4pn7GJT+gJ2uL MVSXxc6goEJ+Wd/Oc+VYfusmq/YFOL5Ia5UFubOUB0cYpRhUM8TyImsPeFuiMQ8YrXr8 5vvt2q/vF/G1TVmxcQtNXp6yleir6cYjQaDJ4VMvTcZDHQoOUhiAfd7X2u6T2WNrxTe/ 1ssQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature :dkim-signature; bh=K8raBC//Ab6v8XITsid3ZkGvItK6gg3vzoyh8Xrtnc0=; fh=1HYLgYaylU3/z29Tc/uVuG9sQVCD6+yYW4fbevTtXUk=; b=E2mYJyNifc2mcq01zFlT+AHN2NUAJzLOLvlGOfdaeGIekEB6+ksyaBKOqNQYVZTu6S sFzNSSbornyIGvdMyOE/VczclWkjdnkY9M0/Qws4KlSQdVferGtoeInHwCCTWG435SGo naKCKGqaiHlfyOHYxMxb4MUoySTEVt91lEFLQ4kzlmCfo9105s4KndVpm8mDCbmF9OHC WfArGK8M/azDuCojSrxLAboMBjgB4Ju6EIK663aXekSkZxhYcuQGp/h49tV8eWBH6JyK iIKDZ3AWIX6seF6+89r7gwjjOmTUedSAsWOhm2VzjeWDTl/toYEnO733c1UPK4ucbg4C ZhKA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b="2/Jz6rR7"; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519 header.b=807BjxIX; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Return-Path: Received: from agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id i5-20020a633c45000000b00578a2466521si1133712pgn.676.2023.10.03.03.41.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Oct 2023 03:41:36 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b="2/Jz6rR7"; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519 header.b=807BjxIX; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 6977E80F7E40; Tue, 3 Oct 2023 03:41:33 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231265AbjJCKle (ORCPT + 99 others); Tue, 3 Oct 2023 06:41:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44836 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230215AbjJCKlc (ORCPT ); Tue, 3 Oct 2023 06:41:32 -0400 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 15A19AC; Tue, 3 Oct 2023 03:41:30 -0700 (PDT) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id C224D2187B; Tue, 3 Oct 2023 10:41:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1696329688; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=K8raBC//Ab6v8XITsid3ZkGvItK6gg3vzoyh8Xrtnc0=; b=2/Jz6rR7SN3g9A0yK1lGV26oQ6Fex7VVwhZWfCcyQ+tE8LjjaVAxo4C5zE0DLxeift5csG jmBZltxWKRsEcCuN72lq9jyctaj/sNAYuKylGB2E+uHfm5f/RTWyuXIQ6lBsxZNuNCG36v CRxPenr6q/q8rOQYvwHrvok9ynylPYk= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1696329688; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=K8raBC//Ab6v8XITsid3ZkGvItK6gg3vzoyh8Xrtnc0=; b=807BjxIXwDQqO2xSDz6NDM4E+gZQXefxh0y0p9CXzDcGXw3mCKVeEqHMUEVoPYgQizlggC 1HhtwRSrbNr2hPCQ== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id B36B6132D4; Tue, 3 Oct 2023 10:41:28 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id 79zKK9jvG2VwawAAMHmgww (envelope-from ); Tue, 03 Oct 2023 10:41:28 +0000 Received: by quack3.suse.cz (Postfix, from userid 1000) id 4C963A07CB; Tue, 3 Oct 2023 12:41:28 +0200 (CEST) Date: Tue, 3 Oct 2023 12:41:28 +0200 From: Jan Kara To: "Matthew Wilcox (Oracle)" Cc: Jan Kara , linux-ext4@vger.kernel.org, linux-fsdevel@vger.kernel.org, "Fabio M . De Francesco" Subject: Re: [PATCH 01/10] highmem: Add folio_release_kmap() Message-ID: <20231003104128.75bh4y4wmwsjvfwl@quack3> References: <20230921200746.3303942-1-willy@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230921200746.3303942-1-willy@infradead.org> X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Tue, 03 Oct 2023 03:41:33 -0700 (PDT) On Thu 21-09-23 21:07:38, Matthew Wilcox (Oracle) wrote: > This is the folio equivalent of unmap_and_put_page(), which remains as > a wrapper for it. > > Signed-off-by: Matthew Wilcox (Oracle) I'm missing a patch 10/10 in this series (and a coverletter would be nice as well)... What's there ;)? Honza > --- > include/linux/highmem.h | 18 ++++++++++++++++-- > 1 file changed, 16 insertions(+), 2 deletions(-) > > diff --git a/include/linux/highmem.h b/include/linux/highmem.h > index 99c474de800d..4cacc0e43b51 100644 > --- a/include/linux/highmem.h > +++ b/include/linux/highmem.h > @@ -551,10 +551,24 @@ static inline void folio_zero_range(struct folio *folio, > zero_user_segments(&folio->page, start, start + length, 0, 0); > } > > -static inline void unmap_and_put_page(struct page *page, void *addr) > +/** > + * folio_release_kmap - Unmap a folio and drop a refcount. > + * @folio: The folio to release. > + * @addr: The address previously returned by a call to kmap_local_folio(). > + * > + * It is common, eg in directory handling to kmap a folio. This function > + * unmaps the folio and drops the refcount that was being held to keep the > + * folio alive while we accessed it. > + */ > +static inline void folio_release_kmap(struct folio *folio, void *addr) > { > kunmap_local(addr); > - put_page(page); > + folio_put(folio); > +} > + > +static inline void unmap_and_put_page(struct page *page, void *addr) > +{ > + folio_release_kmap(page_folio(page), addr); > } > > #endif /* _LINUX_HIGHMEM_H */ > -- > 2.40.1 > -- Jan Kara SUSE Labs, CR