From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out-188.mta1.migadu.com (out-188.mta1.migadu.com [95.215.58.188]) (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 155973F3288 for ; Tue, 4 Aug 2026 07:03:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=95.215.58.188 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785827012; cv=none; b=qfNXc1JuJ7t778C9tjndB7dtxYiN5FDnRXOMAs8nZpg4kX9OKsR2A+rGeeL9zFCos11uct3okoTWRtuYO7qQKSczULC3/9kd2g2+GAqSVh3zkdtRSQoFJd5YM/VfAX3mnmK9N3VZ3ziLIssEsvr6h5fBjBIrclbmW05BBya4/70= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785827012; c=relaxed/simple; bh=8aWuvStpdABJ7BCRRu1iqm/F+CcTvhW+Hl50h1So71s=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=uZo4Pfp1s/gLH3zmZf8ZLjp+4xy5Rp/7UvN6jcYNt0LHV3e4w4aoK6ruyFy4KuSnFVKteXf4fkQtXTGymXt0Sp26kP+S4jn0WDZsHij7hBCu2YHj8qt9giAoVAnjm235jtZauPL361JOj8PRWZojPt9bNCBGWYlUwvwRDCe/FPM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=mnFhO6ua; arc=none smtp.client-ip=95.215.58.188 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="mnFhO6ua" Message-ID: <77c64cfb-012f-4e66-87bc-536bf0fc4ca6@linux.dev> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1785827009; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=LGXxMEje+X28syW3CUW48ogAipcGEhOp2oLAA1LXW0M=; b=mnFhO6uad23oL2cwYkpVjWnqtYQeSYA6+ZX4069KnKztUv8FO9VqF3gbWGtW+4pFrhgasQ HL2s3w/grvo3jCrsOwXhhu5E1AKijhY/3o65OVNr9WQLPeT2zJUOsr8vinGiSqSra9eZXZ zvoWeVV1/CfupH97UGRUFuIytjn+sC4= Date: Tue, 4 Aug 2026 15:03:00 +0800 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Subject: Re: [PATCH v3 2/3] mm: shmem: move unused huge shrinklist queuing past the truncation check To: baolin.wang@linux.alibaba.com Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, hughd@google.com, usama.arif@linux.dev, akpm@linux-foundation.org, brauner@kernel.org, david@kernel.org References: X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Qi Zheng In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Migadu-Flow: FLOW_OUT On 8/3/26 4:46 PM, Qi Zheng wrote: > From: Qi Zheng > > The shmem_get_folio_gfp() adds the inode to the unused huge shrinker list > at the alloced label, but a subsequent truncation check may still fail and > remove the folio, leaving the inode on the list with a stale folio. > > The original code works because the shrinker re-looks-up the folio and > drops stale entries, but it is cleaner to queue the inode only after all > checks that might remove the folio have passed. > > So just make the pure structural move with no functional change, and it > serves as preparation for the memcg-aware shrinker conversion. > > Signed-off-by: Qi Zheng missed adding: Suggested-by: Baolin Wang