From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtpbgbr1.qq.com (smtpbgbr1.qq.com [54.207.19.206]) (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 1C87526AF6 for ; Thu, 16 Jan 2025 08:49:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=54.207.19.206 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737017391; cv=none; b=umMVXowsk5/c+x3osFnaPI1t+uRvwKXhEOA13lK1SagQI0jgooczybewj0t2n9HZRTcPw160EKz+37BFObfdYNhE+NfPfisy8p9lZWmgbl25dSj7+CH0ThYKCdF9YVLURAqh036mH4QuzINQ37w1h9d4O5cp9WFVMxuIKr/BQgQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737017391; c=relaxed/simple; bh=iJSQmZsv7iO33UbkHh01fxhHb6VE3VAft3SWBq8e5Lg=; h=Message-ID:Subject:From:To:Cc:Date:In-Reply-To:References: Content-Type:MIME-Version; b=BqNncREvFFCOI8RNhNGxOnWBa5tSz/G3WOmtCLpnw/imH3yD9PJGAWiKP53OzgLfhqdpH9k8LybbBy1hSxOonCTClofzNqaNBzQ8QZFy3/MZEby/2XlqjIMNpxRXDRLqyA0Igal4G9TffAvqP0cRHlTe9/GsCLUmMmE5CbuAeTg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=uniontech.com; spf=pass smtp.mailfrom=uniontech.com; dkim=pass (1024-bit key) header.d=uniontech.com header.i=@uniontech.com header.b=KyAfrHb4; arc=none smtp.client-ip=54.207.19.206 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=uniontech.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=uniontech.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=uniontech.com header.i=@uniontech.com header.b="KyAfrHb4" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=uniontech.com; s=onoh2408; t=1737017321; bh=BTSJJ9dN2c7B+4kzb4OwUDBrwMiBS+3wBlh03ZbeyeE=; h=Message-ID:Subject:From:To:Date:MIME-Version; b=KyAfrHb49K3vha9ho0rDUex5nSxk4zyZrGlnJfmw7uiAlT2iPfBqeR7ULfW22Q/9d ywZoAzsbPUKi6Y7ZJm7KXzoUdg7iT+pigo4Mh9hhfzekVXrmhNTCU+IE4S8N4/U+5V Z3zpT88XK/Fyrrdf3LyRZZ9zwqxlDj627DPVo5uw= X-QQ-mid: bizesmtp79t1737017313t5p97ssa X-QQ-Originating-IP: uJwDwGzemD7vBgxEkg2C/dl1pinQZTQ0suCMuSBB7rQ= Received: from [10.20.53.121] ( [113.57.152.160]) by bizesmtp.qq.com (ESMTP) with id ; Thu, 16 Jan 2025 16:48:31 +0800 (CST) X-QQ-SSF: 0000000000000000000000000000000 X-QQ-GoodBg: 1 X-BIZMAIL-ID: 13648819181761774000 Message-ID: Subject: Re: [PATCH] erofs(shrinker): return SHRINK_EMPTY if no objects to free From: Chen Linxuan To: Gao Xiang , Gao Xiang , Chao Yu , Yue Hu , Jeffle Xu , Sandeep Dhavale Cc: linux-erofs@lists.ozlabs.org, linux-kernel@vger.kernel.org Date: Thu, 16 Jan 2025 16:48:31 +0800 In-Reply-To: References: <433DB98624BCDF95+20250116072042.189710-1-chenlinxuan@uniontech.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.52.3-0ubuntu1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-QQ-SENDSIZE: 520 Feedback-ID: bizesmtp:uniontech.com:qybglogicsvrgz:qybglogicsvrgz5a-1 X-QQ-XMAILINFO: NV5clquThfFEYb1qI+sYk4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hqkynYdRXESjUWAZpu+Ojy0VamijqoiF2Q sJaZ/aQ+bHe X-QQ-XMRINFO: MSVp+SPm3vtS1Vd6Y4Mggwc= X-QQ-RECHKSPAM: 0 On Thu, 2025-01-16 at 16:45 +0800, Gao Xiang wrote: >=20 > On 2025/1/16 16:24, Chen Linxuan wrote: > > On Thu, 2025-01-16 at 15:51 +0800, Gao Xiang wrote: > > > Hi Linxuan, > > >=20 > > > 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. > > > >=20 > > > > > If there are no objects to free, it should return SHRINK_EMPTY, > > > > > while 0 is returned in cases of the number of freeable items cann= ot > > > > > be determined or shrinker should skip this cache for this time > > > > > (e.g., their number is below shrinkable limit). > > >=20 > > > Thanks for the patch! > > >=20 > > > 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.. > >=20 > > Sorry, I have no idea about that. >=20 > I guess it has no difference if the shrinker is not memcg-aware, > see: > https://lore.kernel.org/r/153063070859.1818.11870882950920963480.stgit@lo= calhost.localdomain >=20 > But I'm fine to use SHRINK_EMPTY since it's clearly documented. >=20 > So could you resend a patch to address my suggestion? v2 patch has been sent. >=20 > Thanks, > Gao Xiang >=20 >=20