From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out30-111.freemail.mail.aliyun.com (out30-111.freemail.mail.aliyun.com [115.124.30.111]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 904431991AE for ; Thu, 16 Jan 2025 08:45:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=115.124.30.111 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737017133; cv=none; b=Kf+b2W7wBepoZ9OnZkEo8qkZIKeG944Ob5Xv4E7KU5HYylTQA3OavscIwfgZy2GNc6gI6DNp8EZzETL4DKK1/yCsr7m4kshypCicmZWGp7Klo/twPHUiFVeLpDUINBBuQfhO6D0ItYk5ZmRYnJ4QkobgJnt9hDbCs62xSF+shHA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737017133; c=relaxed/simple; bh=urxnUpVmF1Da0hpVh3JkqDZZDTna9Xj+MeUlrjvw/RM=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=Yv7/Y8NScsY8mVBZjXDsYpUgVnJjzHuGk5dZVT7COuxY6yCYF86Cw3rF21Mowhr9J9fXzO84MQd55SOo/PGbpeCIoeO8qYPUFjptdk85Z7u3y9EUoPSKW+pi2oF85a+uSc3FwZ6NRs3QiU40koHagSLFTnKkGPe+3kFeybPSOoc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.alibaba.com; spf=pass smtp.mailfrom=linux.alibaba.com; dkim=pass (1024-bit key) header.d=linux.alibaba.com header.i=@linux.alibaba.com header.b=g72KqJC7; arc=none smtp.client-ip=115.124.30.111 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.alibaba.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.alibaba.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.alibaba.com header.i=@linux.alibaba.com header.b="g72KqJC7" DKIM-Signature:v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.alibaba.com; s=default; t=1737017127; h=Message-ID:Date:MIME-Version:Subject:To:From:Content-Type; bh=txoQMmxDklJHnn+SIH4XcL8PyI5x6vLX56gDkuBtPIw=; b=g72KqJC7ZSmYGXKqS2mtKwpQGohD9t2UP/v61GcvLGsfniEHQpIHBSU9UnGQIF91zc2eTTBVp0N4E3ozDS3xCncKOo56tmWBmSyWdWeAZ0pdbx9t6NGBasFtqPvi92ysag2sRlXLj07t9XyRO7icmLrWgeGRpa+HNI0Hz+tTwPM= Received: from 30.221.130.221(mailfrom:hsiangkao@linux.alibaba.com fp:SMTPD_---0WNl2-1y_1737017125 cluster:ay36) by smtp.aliyun-inc.com; Thu, 16 Jan 2025 16:45:26 +0800 Message-ID: Date: Thu, 16 Jan 2025 16:45:25 +0800 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] erofs(shrinker): return SHRINK_EMPTY if no objects to free To: Chen Linxuan , Gao Xiang , Chao Yu , Yue Hu , Jeffle Xu , Sandeep Dhavale Cc: linux-erofs@lists.ozlabs.org, linux-kernel@vger.kernel.org References: <433DB98624BCDF95+20250116072042.189710-1-chenlinxuan@uniontech.com> From: Gao Xiang In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 2025/1/16 16:24, Chen Linxuan wrote: > On Thu, 2025-01-16 at 15:51 +0800, Gao Xiang wrote: >> Hi Linxuan, >> >> On 2025/1/16 15:20, Chen Linxuan wrote: >>> Comments in file include/linux/shrinker.h says that >>> `count_objects` of `struct shrinker` should return SHRINK_EMPTY >>> when there are no objects to free. >>> >>>> If there are no objects to free, it should return SHRINK_EMPTY, >>>> while 0 is returned in cases of the number of freeable items cannot >>>> be determined or shrinker should skip this cache for this time >>>> (e.g., their number is below shrinkable limit). >> >> Thanks for the patch! >> >> Yeah, it seems that is the case. Yet it'd better to document >> what the impact if 0 is returned here if you know more.. > > Sorry, I have no idea about that. I guess it has no difference if the shrinker is not memcg-aware, see: https://lore.kernel.org/r/153063070859.1818.11870882950920963480.stgit@localhost.localdomain But I'm fine to use SHRINK_EMPTY since it's clearly documented. So could you resend a patch to address my suggestion? Thanks, Gao Xiang