Received: by 2002:a05:6a10:8395:0:0:0:0 with SMTP id n21csp36968pxh; Tue, 9 Nov 2021 07:01:39 -0800 (PST) X-Google-Smtp-Source: ABdhPJySeYvPjuosZQkXDDiQ+NXcttf2BJnkqM2SolPRcdldHsy4fq5+5IRUHNNHwaA30Edh3ACf X-Received: by 2002:aa7:c1c6:: with SMTP id d6mr10846021edp.203.1636470099373; Tue, 09 Nov 2021 07:01:39 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1636470099; cv=pass; d=google.com; s=arc-20160816; b=g5T8SWM2ljv1Ui8r1Xa9ZUzDBP2aUYMzNKlQ4YikujgnHVUMRM8Xa8ZpDBWrSE83rw NDe5/ymenFd/Da7g9kp7NMPnybxxKnznMUCM3IlnkCo1jFzZq/pa+o+vcoPYaFvonJU+ X9+g8BeQLPOQ8uE49ObWAxWNYVx7l5Bu3S5HzVswlRF7W44s3MHwx1pgPRQPwnJtEEPL zdj817ImLC+IG+0S5GwtUiTzMsdDJkLeTRv2jrhyWfOET5e8FX6hUyfI6HwV2VbAbkTt wvzB5qz0evRZCa0F+tR9QG4OOldJ3IYWPKoXph1Q3SMBJGZEICtpQZr2/3BH4+J/6otV MpYQ== 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:user-agent:date:message-id:from:references:cc:to :subject:dkim-signature; bh=9JdE2ZBtNj0S4npA8iFstWw6QHus87geSkOYZDmLmdA=; b=tYAyL9hVcEQPQk/CHS6l5nhLi/uPleeMQb5wUvW9r/sftUTaUXxFTIMDq7P6umvX3e zVFFmhz7m0FGbhYTKYGYyh2/q7UNdzIV3xE67hdroG1hLh952Sb2b0JsmxIxZZ0ek0qW rFv34M4Fqz41rxldcoyACeulhOjRefBFZgoTX17z/0FoEt2sA5Ky3LHEs5FBjqNlf6J0 j+Ru/nZy0iGDQzB9VdBOoyu7yr7a1+lrqcY+Eh221zaK/CGnDLB2m80Y3l6FFchdv9Co EM3f9c6wG+yIy03SL3ecWG8vBwM55cyXI7NvS8jGWBHKyNm44OPzMZbej+5Zc1fG070h v52g== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@oppo.com header.s=selector1 header.b=lor4fU5x; arc=pass (i=1 spf=pass spfdomain=oppo.com dkim=pass dkdomain=oppo.com dmarc=pass fromdomain=oppo.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=oppo.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id sb8si43210146ejc.626.2021.11.09.07.01.13; Tue, 09 Nov 2021 07:01:39 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@oppo.com header.s=selector1 header.b=lor4fU5x; arc=pass (i=1 spf=pass spfdomain=oppo.com dkim=pass dkdomain=oppo.com dmarc=pass fromdomain=oppo.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=oppo.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232577AbhKIHqL (ORCPT + 99 others); Tue, 9 Nov 2021 02:46:11 -0500 Received: from mail-eopbgr1300083.outbound.protection.outlook.com ([40.107.130.83]:20928 "EHLO APC01-HK2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S241273AbhKIHqD (ORCPT ); Tue, 9 Nov 2021 02:46:03 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hWOgkh/HFaSCqCXNszdcDYJ1h9gMzppr8g8HxcDKeth5dUqXBEy7j39grtfJaMftXVOHfmON2c77kWUHPMotZKZZSDpZ6BJ8dd3VZ+/nLOaM6W8785o7tIgmnkEUCtQZma7K+lbi56/7mDEfCrzUatCSx86AdGTvxrHFB6SP6557kjEdPfUujrKj5zvUFyHKr7sKkeUXXf/cs0rovaOB9epv53+ZmXRGq4aXVj0kIjcCsgKUil8VQnNz1AooZjMsLIQ1Kjsnox15nr4kGdaKEhgFEBKOJowIpvFbQXYJ7JvwdWuFCdXSvQet4zVbVUMC7RImdWCmgqI25qLTK6zwRQ== 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=9JdE2ZBtNj0S4npA8iFstWw6QHus87geSkOYZDmLmdA=; b=IdqcDtvnlOKKJ6qIW0/X3+cFfzgPoRUnOSH6KP7XNfVAZHgkeghss2mCGp68lg8eDXG9natOvFkqoaaKDobtyt13LlvVg88tQLhPk0O9DJolfKcY4dmpAy+LcLedFsoaQ6BwqR1Sc44JDG2wAhoR8dZ/jGHt96QGUOyn53KbW6woFkEXWRba3Z+SFDy0jGdWWqbnEH44bsVbDSpovTsxi7Onxwy5btA/cIQPri9JjtoP5j3MbIvUdxHQ42qy0iA+YXJoGbRv/JSaMY/j098tc9BQmizhS+nPHjk7kf9Cm4Ud9qAsh8iX3rhgMCoyl02nvhQBDPZCPS/cb4xBG/pr9g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oppo.com; dmarc=pass action=none header.from=oppo.com; dkim=pass header.d=oppo.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oppo.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=9JdE2ZBtNj0S4npA8iFstWw6QHus87geSkOYZDmLmdA=; b=lor4fU5x9ZPmxtHl4QGIEnaKY6rDRDuwJhCYx3BW0RE/LQ3+nYpQf3p2OU/ivrw9XeApR1cMsXMoNWsVX3UHGXnS+SrRbJb/PnNpgjfc33DiGrzGPX6LV068TutAx2E6rqNC9fxAeLPmwBVi+mWyg8OlHiOhmnx2Lbcyb3GpSSQ= Authentication-Results: oppo.com; dkim=none (message not signed) header.d=none;oppo.com; dmarc=none action=none header.from=oppo.com; Received: from SG2PR02MB4108.apcprd02.prod.outlook.com (2603:1096:4:96::19) by SG2PR02MB4024.apcprd02.prod.outlook.com (2603:1096:4:89::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4669.10; Tue, 9 Nov 2021 07:43:09 +0000 Received: from SG2PR02MB4108.apcprd02.prod.outlook.com ([fe80::7e:59ef:bec3:9988]) by SG2PR02MB4108.apcprd02.prod.outlook.com ([fe80::7e:59ef:bec3:9988%7]) with mapi id 15.20.4669.016; Tue, 9 Nov 2021 07:43:09 +0000 Subject: Re: [PATCH 2/2] erofs: add sysfs node to control sync decompression strategy To: Gao Xiang Cc: linux-erofs@lists.ozlabs.org, zhangshiming@oppo.com, linux-kernel@vger.kernel.org, yh@oppo.com, guanyuwei@oppo.com, guoweichao@oppo.com References: <20211109025445.12427-1-huangjianan@oppo.com> <20211109025445.12427-2-huangjianan@oppo.com> From: Huang Jianan Message-ID: <82f7c99e-b83f-90b7-fceb-b8436da94339@oppo.com> Date: Tue, 9 Nov 2021 15:43:06 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.14.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-ClientProxiedBy: SG2PR0601CA0014.apcprd06.prod.outlook.com (2603:1096:3::24) To SG2PR02MB4108.apcprd02.prod.outlook.com (2603:1096:4:96::19) MIME-Version: 1.0 Received: from [10.118.7.229] (58.255.79.105) by SG2PR0601CA0014.apcprd06.prod.outlook.com (2603:1096:3::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4669.11 via Frontend Transport; Tue, 9 Nov 2021 07:43:08 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: a82acf49-6d42-414a-ffc9-08d9a3549334 X-MS-TrafficTypeDiagnostic: SG2PR02MB4024: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:7691; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: fVhJjrH2sOwbkGHrY0GdgsYSuafpaslHU1TfWPIWMIU0RHD9UL6jmW8PF/jCHCofPOezTSkLVlxzcykkI+C+EDs9HY/mevQwI+sv/mD3aQe4YWayIjuSoF4VwpTQQDqpjlqp8h9ogyqMfQwSPuiA4Mgw4D5SWo9AISRb1SskY7upXqaS2ShY9/UJjejN3345i+NRW2g+sBzgo+6zPxLXiyEZAUDy2514xSkADHvAnCCYr7+vuB5Q4/lN+2GwMC5aW7LAKaNqh5z7iCR6Ma75nX6b3Y6JO8AyQvl93tJXF/OEdb4iukUEya/YlNohvN76P4yJ+Xj7FU5AHBrqDLyMC0WNlluMw62TEoGDsFnGpYWKSkQyPL1Ej1Wkc/Mc22F4ee6+/Ezzsd/ZpafmjvO7Pz3bCJ9+boYGJfSrY5We9To2db5BAyHvP+NnxuaVLkhDYFhHgwhKJqrJcxQBPjkIlCvPFX6CbEOaS4IVbHcaHRyTiTKh8TIzSOtqoaqFuGJ7U4SALMM43f+GhEPhJi6NXU+/kJXCtgU3rM/UZ/aYVr4gF+vrcsWgrzxcBcLFC8IdGbuipYQD1kMFnjEuri3rELiHXmbBwwja6m1XXUSfy2r9whmR3hH+VcMJQ0qdmqUU8LqSAkWoBTgFXFSe9AjMY0FpXFwAI9ugWVHQObNog3SMHBHBC2iEN2nE9gF4Ha+xKMgWt6szB7SbK6fip0TF6DO4quUNYglzVe0GLFqzDFpDgCCw1h96hPWhvmI30KPmxhTBnBzNrica+Xvpd42Pbl/4BZPFHdwccfQhtq2XnEHPij/ZH8b6YvqxOeKhVhVbjiJLsnaigP6o8j+z64ZAh6hq2I0RwDGngxrzJmqL8YbFERfMYqQinWYaYPrOXFpm X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SG2PR02MB4108.apcprd02.prod.outlook.com;PTR:;CAT:NONE;SFS:(4636009)(366004)(107886003)(316002)(6486002)(38100700002)(38350700002)(6916009)(2616005)(186003)(508600001)(956004)(16576012)(66556008)(26005)(83380400001)(52116002)(86362001)(31696002)(36756003)(66946007)(2906002)(8936002)(31686004)(8676002)(966005)(66476007)(5660300002)(4326008)(11606007)(43740500002)(45980500001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?NldCR0dLc1JOcG1sNWpkMzlyamVLbmxxcnFJZVlQOWNHT1N3MjZlVDU5VE5E?= =?utf-8?B?UHRQWWtCZXovaXZuRFlyWFI2bUdGb0lTc09LKytiRDJIbzdUSFQrWHZSUjc3?= =?utf-8?B?MEZOYU9hSVBrRkwxYndGMFdyQ1pIWnpVYjhRazNIaHB1OEtwQzZZaGsrVGZQ?= =?utf-8?B?REI4eStlcVZjYzFRYlJyNGxaVXc4VkhVTlNrODZDaHdjSFV1amlTYi9vRTVI?= =?utf-8?B?UmRpWkh6MzNDc2VnOWowSnlha0pXMVBYd0F2OTJGUUs5blF0Nld2YWlWbjgv?= =?utf-8?B?VVJydnAyQTFaR3EzRk9KcUhPUnQxZThNQXlFZDFkSGJpdHFGZEEreVJ5STha?= =?utf-8?B?bnppUnpYMVJD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Ykora0EwMXVo?= =?utf-8?Q?w0s5EBAlVHlo0OAtconWeZQ=3D?= X-OriginatorOrg: oppo.com X-MS-Exchange-CrossTenant-Network-Message-Id: a82acf49-6d42-414a-ffc9-08d9a3549334 X-MS-Exchange-CrossTenant-AuthSource: SG2PR02MB4108.apcprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Nov 2021 07:43:09.2819 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: f1905eb1-c353-41c5-9516-62b4a54b5ee6 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: aGIItg4I9tTVhHzoeaaZEwZC9OiG7XNaCmKNtEpGC1I+Biq0BtNEbGhT7gG70SAsDCTjVES95zEkh2eKZ6joIg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SG2PR02MB4024 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Xiang, 在 2021/11/9 11:16, Gao Xiang 写道: > On Tue, Nov 09, 2021 at 10:54:45AM +0800, Huang Jianan via Linux-erofs wrote: >> Although readpage is a synchronous path, there will be no additional >> kworker scheduling overhead in non-atomic contexts. So we can add a >> sysfs node to allow disable sync decompression. >> >> Signed-off-by: Huang Jianan >> --- >> fs/erofs/internal.h | 2 +- >> fs/erofs/super.c | 2 +- >> fs/erofs/sysfs.c | 6 ++++++ >> fs/erofs/zdata.c | 9 ++++----- >> 4 files changed, 12 insertions(+), 7 deletions(-) >> >> diff --git a/fs/erofs/internal.h b/fs/erofs/internal.h >> index d0cd712dc222..1ab96878009d 100644 >> --- a/fs/erofs/internal.h >> +++ b/fs/erofs/internal.h >> @@ -60,7 +60,7 @@ struct erofs_mount_opts { >> #ifdef CONFIG_EROFS_FS_ZIP >> /* current strategy of how to use managed cache */ >> unsigned char cache_strategy; >> - /* strategy of sync decompression (false - auto, true - force on) */ >> + /* strategy of sync decompression (false - disable, true - force on) */ > Please leave false - auto. Agree. >> bool readahead_sync_decompress; >> >> /* threshold for decompression synchronously */ >> diff --git a/fs/erofs/super.c b/fs/erofs/super.c >> index abc1da5d1719..26585d865503 100644 >> --- a/fs/erofs/super.c >> +++ b/fs/erofs/super.c >> @@ -423,7 +423,7 @@ static void erofs_default_options(struct erofs_fs_context *ctx) >> #ifdef CONFIG_EROFS_FS_ZIP >> ctx->opt.cache_strategy = EROFS_ZIP_CACHE_READAROUND; >> ctx->opt.max_sync_decompress_pages = 3; >> - ctx->opt.readahead_sync_decompress = false; >> + ctx->opt.readahead_sync_decompress = true; > Please leave readahead_sync_decompress = false 'auto' by default. > > I don't like .readpage() applies async decompression since it's > actually a sync way, otherwise, it will cause more scheduling > overhead, see: > https://lore.kernel.org/r/20201016160443.18685-1-willy@infradead.org > https://lore.kernel.org/r/20201102184312.25926-16-willy@infradead.org Maybe consider adding a disbale strategy? And then we will have: 0 - auto, 1 - force on, 2 - disable I will try this in the next version. for .readpage(), If the decompression can be done in a non-atomic context, there will be no additional scheduling overhead? In this case, we can turn off the syncdecompression. Thanks, Jianan > Thanks, > Gao Xiang