Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp1671619iog; Sat, 25 Jun 2022 16:21:46 -0700 (PDT) X-Google-Smtp-Source: AGRyM1sODacq7yww+6BgCe0+ZLC65qZAp3lsF77MvalzRJiGZ18z6YBN9vMt4YGojxJMnmWjcOUp X-Received: by 2002:a17:903:2345:b0:16a:28ac:1c1b with SMTP id c5-20020a170903234500b0016a28ac1c1bmr6760944plh.106.1656199306283; Sat, 25 Jun 2022 16:21:46 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1656199306; cv=pass; d=google.com; s=arc-20160816; b=WXShvDHZ2nWJaACows1HyixJSvUVkzMqvly6NfesIUIDo6VD8aq6TkggA5gky9hOgZ U0PQ+6dcjej8IC34ja5cIJ06NQh1OofeLTOLd+mUv18kQURiSgScY89j59owKdGxzH8F QMrLg2WKnDnrleunanyGRIop3EQfJcVs+x1j9U8hMeWnGvG+W0It8zUzodT9E3wYn4CG 5U3HQ2uJrov55rVLta4jI/7IUiA0Yg+pkxdztC34Rs6LepSybCmbn/S7+Nt+Oflz1+m2 p4NTDX0PuyKWwfRtT4EiGOg979RprmT6vYuWBUFYpXI1JgjINMqHjQL2zNvj0ZVokqE8 P4Ew== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :in-reply-to:from:references:cc:to:content-language:subject :user-agent:date:message-id:dkim-signature; bh=3tXetC1KTZ7TrIx0ND9aci6HN/hQN2kfrkh/jeEvyQ0=; b=t150QiMU/vb9q6lk190GO+CGfbebJGWCVL2nQN4IKmodZifecomCLw5CAjfFzjGMBW mIX3YGwK5oESR0hJtfO2yWmJzpiPCkGpmX6McK+pKgIvHC9HkmiK5nQOdTPcb4fA16Xs 9PoSzFfMkKyCaLCRA9TXYNDKjJFflnXGyKfFYOwkf8Pmb+nSXPhNMZyzSc+mb+IiX4Hd vdC0J0313c4aW3b6yFqN/vezwLkz/zc9WHPm4NKbmTs5TQPOShh2RWh2rSKdAETgOMtt fai+BUmxtK/cG/ooy5rHWeDXKiq2YsEx+p9Wlr3yncQVVjkbandzdKdZgRoZG07I0kmk Yffg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@suse.com header.s=selector1 header.b=SY00fHcK; arc=pass (i=1 spf=pass spfdomain=suse.com dkim=pass dkdomain=suse.com dmarc=pass fromdomain=suse.com); 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h3-20020a170902f54300b0016a496aedefsi9842879plf.300.2022.06.25.16.21.34; Sat, 25 Jun 2022 16:21:46 -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.com header.s=selector1 header.b=SY00fHcK; arc=pass (i=1 spf=pass spfdomain=suse.com dkim=pass dkdomain=suse.com dmarc=pass fromdomain=suse.com); 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233537AbiFYXEP (ORCPT + 99 others); Sat, 25 Jun 2022 19:04:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40842 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231317AbiFYXEO (ORCPT ); Sat, 25 Jun 2022 19:04:14 -0400 Received: from EUR01-HE1-obe.outbound.protection.outlook.com (mail-eopbgr130088.outbound.protection.outlook.com [40.107.13.88]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 89EE9E0BC; Sat, 25 Jun 2022 16:04:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=J/ZwlbwpnIoRL1bJ9M1B+JBp95mvqyzX/4yZaJu4pqvMK5avILhW+X17Kv8cvuoXX+BgMzhhzsi/DP4E9fDIT5m0etsnP9TLCbV9D5Tds/uCph84da6nz1dDVkK/UffLZFrjYw6DePt+EwxQPVYTxCWCisB82wgCu6vObN9G41hyhjj0yvC/I3r4JqaldHz2wkzlP0bCJi0s6dL7rawrejVB7CF20Uj5kqKhmcgDmeM2lO2dIJTdpzVpCEaTIOF89OIsTcvJ8TxdzTrPvRz8IslBHxiBf1djYJXhzQ2dG+gOYm8ps9hrwOTyecWUHNNtl/gK8g3zDJqZ6CS9EgTHnA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=3tXetC1KTZ7TrIx0ND9aci6HN/hQN2kfrkh/jeEvyQ0=; b=IA+Hx7ql/YUdDrN7I3h9QPNF6z8zi0GK01M/OD1I5xeUv/x2OelKKrARmRIrI8+UmfA/71CFr904nzqLzJYvka4444pcA2qIfJS4C/HDESCKZr2jbBUYA6Y2lSwJRZX9d9wqhWVJKPgEZwWO9/eDCMJPr7SP/XBaYVDu31XNg4yZrmTdfLEwYcrU0x7Ejy7A5OD6k0RDQbwYISEhpMZDBaJEfwqc75OgtH89aSxH9R+Cv+8vlviGNqg37PXFM+RQiLk3fDxyxn1qUmUgIeWLbgIrxoQsJIqHXLap1fD2eN3IZ7vg28EKtYIDsMjQ+1stzqbcjoNMQHCN4VfSLrkUlg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=3tXetC1KTZ7TrIx0ND9aci6HN/hQN2kfrkh/jeEvyQ0=; b=SY00fHcKSq1eFldL5I07vHefhvSubTJSfhSnBcm7GWgmAj7HS8qHM63nM4JZoP9qHTJUOJK1JivUXX+XS5J32Fs+f0dUjvWVzEjRJfv5V5NiCG6NxL/8Q8velkTFx5ifxeoOed2sRDJE2N5gllfBC8NcM4St//g1L2aVsRdLrfzMdnw8w5FiLkDfWpq7aAuEmxgepGsnSR7/Qa88QdTVLKY3m5Jcd11yMvpq9TwrHgkmFWXKiWkYE6kk/AHF3sPOqMGxYiD4edmemDqEV/9wOIN/wPOndNDF0Gu5icx0UHKTOUvdoD3+dbYjyTNi6uubO6d+Po/iTXpdMu92fz315Q== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com; Received: from AS8PR04MB8465.eurprd04.prod.outlook.com (2603:10a6:20b:348::19) by AM0PR04MB6884.eurprd04.prod.outlook.com (2603:10a6:208:183::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5373.18; Sat, 25 Jun 2022 23:04:07 +0000 Received: from AS8PR04MB8465.eurprd04.prod.outlook.com ([fe80::2581:79a4:26f2:44e9]) by AS8PR04MB8465.eurprd04.prod.outlook.com ([fe80::2581:79a4:26f2:44e9%5]) with mapi id 15.20.5373.021; Sat, 25 Jun 2022 23:04:06 +0000 Message-ID: Date: Sun, 26 Jun 2022 07:03:55 +0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.10.0 Subject: Re: [PATCH] btrfs: Convert zlib_compress_pages() to use kmap_local_page() Content-Language: en-US To: "Fabio M. De Francesco" , Chris Mason , Josef Bacik , David Sterba , Nick Terrell , Chris Down , Filipe Manana , Nikolay Borisov , Gabriel Niebler , linux-btrfs@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Ira Weiny References: <20220618092752.25153-1-fmdefrancesco@gmail.com> <3110135.5fSG56mABF@opensuse> From: Qu Wenruo In-Reply-To: <3110135.5fSG56mABF@opensuse> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: BY5PR17CA0007.namprd17.prod.outlook.com (2603:10b6:a03:1b8::20) To AS8PR04MB8465.eurprd04.prod.outlook.com (2603:10a6:20b:348::19) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 67bb478b-00ab-44fd-4a53-08da56ff0146 X-MS-TrafficTypeDiagnostic: AM0PR04MB6884:EE_ X-LD-Processed: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba,ExtFwd X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: m6FuJQAmYSdpNAzb7hU58NintoRqnUq+BF8eG/YrnF9F71NcPmhXtCSIssdMZ4ZQAjHFwPhZhOIj1A1b0UxLulBOSbgQvXAB4lJaJ5jJlE6KeRPkgoDRY9s63wyTVkECPp/giFlxgDhhBbK88YKdH9mPnhe6CKhqRj/kVwJE/9qO4jhXTIDn3x+Qz+w0klOfLL0O2TYbyrXzNfkNDdmrfTa18z6UbrPwQe6wNJcRecWGpbrnbvhbN7ezC+1ATzbaK5sMxtoBMuA0lukExnhGYunU3SRnUFrwQcPuMx668T8nPAdfew4reYexqYIhHBmPnKLJRO56U2xIlx7AQCsV8+IqjsZQ/DF7RUKScHCrct3oT3cCjak2s1z6eQAL2/T6r74o0rpXS478Zl+hL3uC9WmqLYBQvgUxcSQCZJHfV9Kko+EE+q5MdD7P3rq+CIKvUXKRnw3EVGeixhuxm17I9kDCkjwZTviaQPeBvu4kYOoiF29rBEYYQDD6T4BSzBi2PqHvXwkabCrC5qWIJTDV1peB5ceDhGBW9i6zJbxDmY7TNs3xdAw08xGav0lcMGnWZWcKDDkJkwOA0ZzxX7y4ACLrb/8EM7kz01urXtp0qojH5yySU5JJrcCX883vacBx6yBcBifkZGFGgKLxNak1nGsmw/eGOkMg0kNtP8+/4ojsoN3Th/nkBdaBLXkPu9D3hbZ2o2/t5uxj1Eo1jVIKi8tpeCYCcuuyGPkUlAs9rcV/87QVADI9KXHpfkBSYSZzQB5O2dFAMNIDh+KPdpRLUNO5LQ/hwwps9Wq+039VfJonRO/2czrB0Gm+wwqNWgNrkWoUBePSljHSNevficfz1KCma8GhpHw6q579wDCdUKk= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AS8PR04MB8465.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230016)(376002)(39850400004)(346002)(396003)(366004)(136003)(5660300002)(2906002)(36756003)(41300700001)(86362001)(31686004)(8936002)(186003)(2616005)(8676002)(31696002)(966005)(6486002)(316002)(38100700002)(6506007)(53546011)(110136005)(478600001)(921005)(66556008)(66946007)(6512007)(66476007)(6666004)(4326008)(43740500002)(45980500001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?ZGtwUmdaL2VaMU5MVEprY2hvNHd0a0dIM0pUb0lkc2w5NUV1L21ZZ1B2Umxr?= =?utf-8?B?bTdKUnZtSElBMUZvRU5RajY4bXBSSk9Yc29pbXVvMDFqSzNNcnNzWHRtOGhG?= =?utf-8?B?RVlrNnV1MzdKWkhkUzJxZDhNZGczZTdjejFMbml1QVNNdDVqUXBpTm5VR09W?= =?utf-8?B?cEs2N2hhelp5enZSZzVvV3o2am9iNkNNdEVtTHMvTHFlN2ZTTjUxbW83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DU3d0lmSmlIc2VZVjcxdDE5R3Zhb3Nvd0JTWlFXOTBXbS9nOHJPT1F1?= =?utf-8?B?ai9ISVRUTzc3dVZJUCtOTWtQNFVFa1pONmY4VDAyL0VmNEp3VWg2WFV1emZU?= =?utf-8?B?bXFWL1Y3M1ZhN2tBMldMcDJ4bHJneWpwU2hpWVN2ak1jblhxUncybTBCeWNi?= =?utf-8?Q?4DlTWIHBJ+QU0a60LCZOlb8=3D?= X-OriginatorOrg: suse.com X-MS-Exchange-CrossTenant-Network-Message-Id: 67bb478b-00ab-44fd-4a53-08da56ff0146 X-MS-Exchange-CrossTenant-AuthSource: AS8PR04MB8465.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Jun 2022 23:04:06.5785 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: DgEb6OvfmGGRjwppS5beiPK9sHQ+3W3w3tgiIKi7pxM8PWseJOkAGvmcb39inkqz X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR04MB6884 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,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 2022/6/25 22:41, Fabio M. De Francesco wrote: > On sabato 18 giugno 2022 11:27:52 CEST 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. >> >> Tested with xfstests on QEMU + KVM 32-bit VM with 4GB of RAM and >> HIGHMEM64G enabled. This patch passes 26/26 tests of group "compress". >> >> Cc: Qu Wenruo >> Suggested-by: Ira Weiny >> Signed-off-by: Fabio M. De Francesco >> --- >> >> This patch builds only on top of >> "[PATCH] btrfs: zlib: refactor how we prepare the input buffer" by Qu > Wenruo". >> https://lore.kernel.org/linux-btrfs/ > d0bfc791b5509df7b9ad44e41ada197d1b3149b3.1655519730.git.wqu@suse.com/ >> > > I've seen that Qu sent a v2 of the above patch. However David thinks that > it is better not to map pages allocated in zlib.c for output (out_page) > since they cannot come from highmem because of "alloc_page(GFP_NOFS);". > > @David: > > I suppose that, since it builds _only_ on top of the refactor submitted by > Qu, I'll have to wait and see what you decide. > > If you don't want kmap_local_page() and prefer using page_address() on > "out_page", please drop this patch and let me know, so that I can send a > new patch which will be in accordance to your preference. And that would also make the convert much easier for kmap_local_page() of input pages. I'll hold the refactor patch after all the kmap code is converted. Thanks, Qu > > Thanks, > > Fabio > >