Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp2339224imu; Fri, 23 Nov 2018 07:49:40 -0800 (PST) X-Google-Smtp-Source: AFSGD/WvkYEJLgioqYX47Ww8hrGbW3mWguoFiKnDYp+Z+TNiwweWmSQ/P3ww6DFxnbkJZDwVg5hI X-Received: by 2002:a63:fb10:: with SMTP id o16mr12033739pgh.211.1542988180498; Fri, 23 Nov 2018 07:49:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542988180; cv=none; d=google.com; s=arc-20160816; b=txR2wG3FfVsUs2MxFKBmEBoAi0+vdUfIo8KTL1XdS7y/uqU4qZGZ8mmyfosoKystFW PJY3vHBkhMZcZP2vxgZMl+W26xWFoPjUhCXP6iCYSPs71K0kQl7Pn/EGMGC5aPuf/+Wr DoMe1sjfhAvc0b+7ES4FsUyykCGyZJ6Ia1KKzywNSg3Ik5ZvfLfS0a2JljFPyqyjUum/ ENlZTBuIIg3A/9HV5tHJpQqekag/REu93H77gucfwWjjMdqfiZUUtd++Afr8NrZarzlO r7UNmxjTpfvMFCxGYaDkDuGiRbNGyzQoVcD4wawpLR9jWIyDbD3DyaZICLbwCZEjZUJF YqGQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=cdYyEYamVpAc7tF1KvW03GSj2ZmlVX+F8PX0KO8nxq8=; b=WTeR52hUd1olM9hSlpMaIt89TAvwpNm2DgZC8MgmWTrbkvlcJkRJInTcbjeNNnzXEF luOXG5Wxj/V2KykoKL35ikFiNXbsBcHKEf5rUtj9z5ojUjPaN22vnNLxcc9e2zBSYrlu 5jLrrO//48qH9kDTz/Gsajl9/+JHif66preDGpQTCyGX6L1xSSr6irKjed/4N/Wg3BLU DwXvc0o8FORrAQnA0EWY2zntUA5oiP2/cYNhxc/kNaLpiGImTz2990yOAfbtW/HXfg6s Au2w/ky9iWl6f81KB2rskbm0E0yxwzx3uNpUZPI1+oTEq+gju21AnkoJTWxt9c4/8+Gp 6E4A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=FXtwnPnX; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 194si49814459pgg.519.2018.11.23.07.49.24; Fri, 23 Nov 2018 07:49:40 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=FXtwnPnX; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2391204AbeKVXFj (ORCPT + 99 others); Thu, 22 Nov 2018 18:05:39 -0500 Received: from mail.kernel.org ([198.145.29.99]:48296 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731683AbeKVXFj (ORCPT ); Thu, 22 Nov 2018 18:05:39 -0500 Received: from localhost (5356596B.cm-6-7b.dynamic.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id DAA9420684; Thu, 22 Nov 2018 12:26:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1542889589; bh=bzEOeGfx6R+iYfswBeNaB5BHMcnRpPPCcmXVV4b6RmU=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=FXtwnPnXgGCYTfUFIV/cAHQJjNhiSxJ11uMX2s80NTS1flEKLO/oWJ2afAY8iCSSa P/eYwWGMPRD2MhZam4e5IIKZqW0KETac0AbP1ifo/bTkNDZ6q+wAs/PU01D4YzUa+e ZnxPyyw+mCbNvl8ufGSuWnzzwTLiy6ehgeNs45iA= Date: Thu, 22 Nov 2018 13:26:27 +0100 From: Greg Kroah-Hartman To: Gao Xiang Cc: devel@driverdev.osuosl.org, linux-erofs@lists.ozlabs.org, Chao Yu , LKML , weidu.du@huawei.com, Miao Xie Subject: Re: [PATCH 02/10] staging: erofs: fix race when the managed cache is enabled Message-ID: <20181122122627.GC10212@kroah.com> References: <20181120143425.43637-1-gaoxiang25@huawei.com> <20181120143425.43637-3-gaoxiang25@huawei.com> <20181122101711.GA3189@kroah.com> <55aed87f-196e-9048-6aae-db09bc497664@huawei.com> <20181122110642.GE5287@kroah.com> <78f8bed5-5f7f-8ca6-5d7a-3a94a2062425@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <78f8bed5-5f7f-8ca6-5d7a-3a94a2062425@huawei.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Nov 22, 2018 at 07:43:50PM +0800, Gao Xiang wrote: > Hi Greg, > > On 2018/11/22 19:06, Greg Kroah-Hartman wrote: > > On Thu, Nov 22, 2018 at 06:42:52PM +0800, Gao Xiang wrote: > >> Hi Greg, > >> > >> On 2018/11/22 18:17, Greg Kroah-Hartman wrote: > >>> Any specific reason why you are not using the refcount.h api instead of > >>> "doing it yourself" with atomic_inc/dec()? > >>> > >>> I'm not rejecting this, just curious. > >> As I explained in the previous email, > >> Re: [PATCH 04/10] staging: erofs: fix `erofs_workgroup_{try_to_freeze, unfreeze}' > >> > >> we need such a function when the value is >= 0, it plays as a refcount, > >> but when the refcount == EROFS_LOCKED_MAGIC (<0, but not 0 as refcount.h), > >> and actually there is no need to introduce a seperate spinlock_t because > >> we don't actually care about its performance (rarely locked). and > >> the corresponding struct is too large for now, we need to decrease its size. > > Why do you need to decrease the size? How many of these structures are > > created? > > As I said in the previous email, every compressed page will have a managed structure > called erofs_workgroup, and it is heavily allocated like page/inode/dentry in the erofs. Ugh, every page? Ok, nevermind, I take back my objections. You all are crazy and need to do crazy things like this :) greg k-h