Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp1908417pxu; Tue, 24 Nov 2020 11:47:50 -0800 (PST) X-Google-Smtp-Source: ABdhPJwqpxGjDCxRsmFZKWOl1XwbDIqRPgil74lSAzdDxJNI5dzq1fSIjksnr+RG6LCRTuSWm8+M X-Received: by 2002:aa7:ca44:: with SMTP id j4mr102257edt.354.1606247270278; Tue, 24 Nov 2020 11:47:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606247270; cv=none; d=google.com; s=arc-20160816; b=F1GLATwxxV/5eUAsIRk7D/Rp0sd/W08KMRjhbv9N8BpEz5/eTvcKbT0HOlrzc8ZnGx mA57THm16VI+k/pDJdjT8cfA5ABJDeKqtNPoW5pSQWLDGGNrY3gYF3BRCFRhNqCPfqwo 9eSaSoc56h6Bi6DOYPr2HIet1IUZBis0OJl6YZAOqiVRS65TcT6bkqEJDTrhnXJAjBOk Fbtpbkou5+apJfFayMFxhpeNBqSbkXJOiVk0jyLm7foQwCS75Uj4D0GzH27+TCci8ZRi 0wX+yzfzSaJ1kfXV7LYvoZMl/t94KoGQob3TC3QeHWxOU9qh3WyOOKjxYD4mQyTrH5CF WNaQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=OcyH2/0ClC1O6nkYHZAgvDHCsFl19G4dmGGYuCwZaZg=; b=ACv+SZsonx4SFNPmYAamHqgP0ogZJLmEbMN4WcIaQjdyd47hVxQYyUUMh3vAibUelD VB2lHe6roqwD4v7+HNQiJjGV/Lu9kuohvwlwaqGiscu8ngnBBjHWxMEtnQExj6evM5ae P65a3o3Xg+xg55x0MZeOLrw6vALr/qlxPJRzbzhTW8JL5bFeO2Val7Iny8E8v5BslMOH kLIdqoLVJ/6H/hxW9lMkKpISXtfcHTIrPMBN9xgm/J98ILQDMwtseXSVTnnjRguYXNFi qcM8UGlhLSokBj6FRJOh+ecB64tLX1m3lytwhxCzhp4Zt+oeiAjx1loJm2fDstb/ocDU LEJg== ARC-Authentication-Results: i=1; mx.google.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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id q26si9015350ejb.105.2020.11.24.11.47.26; Tue, 24 Nov 2020 11:47:50 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728515AbgKXDMW (ORCPT + 99 others); Mon, 23 Nov 2020 22:12:22 -0500 Received: from szxga06-in.huawei.com ([45.249.212.32]:7970 "EHLO szxga06-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728106AbgKXDMV (ORCPT ); Mon, 23 Nov 2020 22:12:21 -0500 Received: from DGGEMS411-HUB.china.huawei.com (unknown [172.30.72.59]) by szxga06-in.huawei.com (SkyGuard) with ESMTP id 4Cg8Fd4zNjzhdMV; Tue, 24 Nov 2020 11:12:05 +0800 (CST) Received: from [10.136.114.67] (10.136.114.67) by smtp.huawei.com (10.3.19.211) with Microsoft SMTP Server (TLS) id 14.3.487.0; Tue, 24 Nov 2020 11:12:14 +0800 Subject: Re: [PATCH] f2fs: change to use rwsem for cp_mutex To: David Laight , 'Sahitya Tummala' , Jaegeuk Kim , "linux-f2fs-devel@lists.sourceforge.net" CC: "linux-kernel@vger.kernel.org" References: <1606109312-1944-1-git-send-email-stummala@codeaurora.org> <7f5213fb9b334d1290f019ab8ed6ee71@AcuMS.aculab.com> From: Chao Yu Message-ID: Date: Tue, 24 Nov 2020 11:12:14 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <7f5213fb9b334d1290f019ab8ed6ee71@AcuMS.aculab.com> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.136.114.67] X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2020/11/24 1:05, David Laight wrote: > From: Sahitya Tummala >> Sent: 23 November 2020 05:29 >> >> Use rwsem to ensure serialization of the callers and to avoid >> starvation of high priority tasks, when the system is under >> heavy IO workload. > > I can't see any read lock requests. > > So why the change? Hi David, You can check the context of this patch in below link: https://lore.kernel.org/linux-f2fs-devel/8e094021b958f9fe01df1183a2677882@codeaurora.org/T/#t BTW, the root cause here is that mutex lock won't serialize callers, so there could be potential starvation problem when this lock is always grabbed by high priority tasks. Thanks,