Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp4211387imw; Thu, 7 Jul 2022 14:49:00 -0700 (PDT) X-Google-Smtp-Source: AGRyM1sqboD8xjpaFynxsz/HNHITJpYahgTzQX5Q55ox8FPERvsTO01yhH4QlJePwIzmzG9UXq7v X-Received: by 2002:a17:902:8d84:b0:16b:f76a:521f with SMTP id v4-20020a1709028d8400b0016bf76a521fmr134409plo.36.1657230540444; Thu, 07 Jul 2022 14:49:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657230540; cv=none; d=google.com; s=arc-20160816; b=EjYcPWft+Ujkw3XBExYJinCk76r3SvZR0aVSNMxbxKHeE5yLkJ9DkYulwbFeiEpeUk 68PiK7E53HRff2N6sZwpCTvlaxKeOfVvbg3tNLmh4Xdl3WVPX6hnxvJxPvKiN+OQG8qe 5ue7O715zn7LGkQtg4kNXT5fW0ON/m9fXaDeWYHs35NCtWyfBGUiqDLgkkdxfFkcSRPm xiMAMGln/ES5kSmvF2prJJzA2W3MAYN3i7k4mMUAh9hjMwkBzqkQTBl7KL7YxwTn9cYd Myulbzj9bZzbWfhBSsD1JKOHJ/rrrctxP0bhROHUflByD1opORCMCw0SQcJfmRsArQE2 3f2w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:mail-followup-to:reply-to:message-id :subject:cc:to:from:date:dkim-signature:dkim-signature; bh=M9nWttnTjLTkr2l2HLhvCYKnJfzWGL1Z7RGCnCMX74Y=; b=IOarAEfZy3ZN+dF5F+pFkbVn0q93IkEPldKoJLDSKvizf6W841vyVEYfTj/x+njTaE rfuehJFGvRbLrqXhy29pkbjAkh+Ppih2HTj+o6YpZfi0au4bTJd1cNiuNoO+fn0gaI3K 6flypz1ZXPZRsg1pI+b7Up/wLy7vq0bb7zk7EiZ7U7RFn8LlRXcMVmJnygFISrNVOuo/ mKVrJajiwekvuReA+FXrHP76+J59hx5nnrfZo+ALMNpqjUpa8KUkg3yXXcqYdpNIJbtK cPMAS1/A6wCR7Xj+LGMg7cXRuNNGt9IlpfyHkQyCBSr+y8oPRYaVnwIqMunl6/66VIeI d8ZQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=R2GCZYHP; dkim=neutral (no key) header.i=@suse.cz header.b=DGiS3u3Y; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j4-20020a056a00234400b005061eb330a1si39459032pfj.351.2022.07.07.14.48.04; Thu, 07 Jul 2022 14:49:00 -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=@suse.cz header.s=susede2_rsa header.b=R2GCZYHP; dkim=neutral (no key) header.i=@suse.cz header.b=DGiS3u3Y; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236790AbiGGVW0 (ORCPT + 99 others); Thu, 7 Jul 2022 17:22:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36150 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236555AbiGGVWY (ORCPT ); Thu, 7 Jul 2022 17:22:24 -0400 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F049431DFD; Thu, 7 Jul 2022 14:22:21 -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-out2.suse.de (Postfix) with ESMTPS id 3C06C1F9DA; Thu, 7 Jul 2022 21:22:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1657228940; h=from:from:reply-to: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=M9nWttnTjLTkr2l2HLhvCYKnJfzWGL1Z7RGCnCMX74Y=; b=R2GCZYHPoaP31/u/8x/YhrMoFV9db0/izqohgXrxXjlaJyxf4cgb0LjkM61lfUA6eFvbFY jfsA+KZozvrHZJJkM2kP4CPvrLyWID5w371APXL54Zj5DpG15Jsh/M99zUJN3+rrXBwxYZ qdOrC2dLNj61Rq1Q7bPyeYlj0nGw+vM= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1657228940; h=from:from:reply-to: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=M9nWttnTjLTkr2l2HLhvCYKnJfzWGL1Z7RGCnCMX74Y=; b=DGiS3u3YOVO8bYfWBg+pgVg46WS3cpIH9WCb/jITUr7D9+PDGVBiVsdZgE50iXBt+ikfn7 AVSi8en1MtmHD2CA== 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 D70EA13461; Thu, 7 Jul 2022 21:22:19 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id g0F9M4tOx2IITQAAMHmgww (envelope-from ); Thu, 07 Jul 2022 21:22:19 +0000 Date: Thu, 7 Jul 2022 23:17:33 +0200 From: David Sterba To: "Fabio M. De Francesco" Cc: Chris Mason , Josef Bacik , David Sterba , Nick Terrell , Chris Down , Qu Wenruo , Filipe Manana , Gabriel Niebler , linux-btrfs@vger.kernel.org, linux-kernel@vger.kernel.org, Ira Weiny Subject: Re: [PATCH] btrfs: Convert zlib_compress_pages() to use kmap_local_page() Message-ID: <20220707211732.GP15169@twin.jikos.cz> Reply-To: dsterba@suse.cz Mail-Followup-To: dsterba@suse.cz, "Fabio M. De Francesco" , Chris Mason , Josef Bacik , David Sterba , Nick Terrell , Chris Down , Qu Wenruo , Filipe Manana , Gabriel Niebler , linux-btrfs@vger.kernel.org, linux-kernel@vger.kernel.org, Ira Weiny References: <20220627163305.24116-1-fmdefrancesco@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220627163305.24116-1-fmdefrancesco@gmail.com> User-Agent: Mutt/1.5.23.1-rc1 (2014-03-12) X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE 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 Mon, Jun 27, 2022 at 06:33:05PM +0200, Fabio M. De Francesco wrote: > The use of kmap() is being deprecated in favor of kmap_local_page(). With > kmap_local_page(), the mapping is per thread, CPU local and not globally > visible. > > Therefore, use kmap_local_page() / kunmap_local() in zlib_compress_pages() > because in this function the mappings are per thread and are not visible > in other contexts. Furthermore, drop the mappings of "out_page" which is > allocated within zlib_compress_pages() with alloc_page(GFP_NOFS) and use > page_address() (thanks to David Sterba). > > Tested with xfstests on a QEMU + KVM 32-bits VM with 4GB of RAM booting > a kernel with HIGHMEM64G enabled. This patch passes 26/26 tests of group > "compress". > > Cc: Qu Wenruo > Suggested-by: David Sterba > Suggested-by: Ira Weiny > Signed-off-by: Fabio M. De Francesco Added to the kmap patch queue, thanks.