From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out-179.mta1.migadu.com (out-179.mta1.migadu.com [95.215.58.179]) (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 710C8319858 for ; Tue, 6 Jan 2026 11:19:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=95.215.58.179 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767698379; cv=none; b=kKdsVw6w3tMb2D04zjTcq9t4vGxiUMhpZfgS5Z7BLpIBVApVxusLcHmru7jOTuhOsRkQ2ivz+tCPNXiVVD2H1L9z8xFLKT6pDqi0K095BIJ3LteCgIKicV/UkrHzAODaLSrN1iIbi4/kEofcj4miIPrlg/QwvQQnwvryo3X7aBg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767698379; c=relaxed/simple; bh=uS4gJ/AfZP3ToQIHRk162WjGdTGW2gsO+lu7tA8Nk04=; h=MIME-Version:Date:Content-Type:From:Message-ID:Subject:To:Cc: In-Reply-To:References; b=E16XjBBdkRDzc8ggeQ5nRxKPQVLuSTAnjqoQFbV8CymAc0NfNuBYOKgMPeGRleZwJoEgPyn986nFppJKPLO1dlFUOHmtmmk94HMNF/Ss8U/h8Bi5E3TgJqDtNq2eEmp8FIH05dBXDeWUNP8Sp5uzCKMy04r0pO3aPxqwJLIYwxI= 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=OhCh+yZX; arc=none smtp.client-ip=95.215.58.179 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="OhCh+yZX" Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1767698370; 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=RxmNw8YNH8htTjmTZyblWLK2VY0PjffdH8VXCg/kWWw=; b=OhCh+yZXjeB2LCOKtLfiYL+Mx4h4GgbDe4uyuaYuMcx5T1fo00IchJECKN/BEs9uymqrZe Ou4AECQg8/aBayX+XNa6Z5vGDbCkRODIc4+bB+AAhJ8tNUFyVHqirrZ7V/P2w2LQKDTINV Os7hlgr+28HxQEN6VKd4iBsW/Z+Pmo4= Date: Tue, 06 Jan 2026 11:19:21 +0000 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: "Jiayuan Chen" Message-ID: <52cc0b2671b068903c6580b7431db0f22982ae86@linux.dev> TLS-Required: No Subject: Re: [PATCH v1] mm/vmscan: mitigate spurious kswapd_failures reset from direct reclaim To: "Michal Hocko" Cc: "Shakeel Butt" , linux-mm@kvack.org, "Jiayuan Chen" , "Andrew Morton" , "Johannes Weiner" , "David Hildenbrand" , "Qi Zheng" , "Lorenzo Stoakes" , "Axel Rasmussen" , "Yuanchu Xie" , "Wei Xu" , linux-kernel@vger.kernel.org In-Reply-To: References: <20251222122022.254268-1-jiayuan.chen@linux.dev> <4owaeb7bmkfgfzqd4ztdsi4tefc36cnmpju4yrknsgjm4y32ez@qsgn6lnv3cxb> <2e574085ed3d7775c3b83bb80d302ce45415ac42@linux.dev> X-Migadu-Flow: FLOW_OUT January 6, 2026 at 17:49, "Michal Hocko" wrote: >=20 >=20On Tue 06-01-26 05:25:42, Jiayuan Chen wrote: >=20 >=20>=20 >=20> That said, I believe this patch is still a valid fix on its own - r= esetting kswapd_failures > > when the node is not actually balanced doesn't seem like correct beh= avior regardless of the > > broader context. > >=20 >=20Originally I was more inclined to opt out memcg reclaim from reseting > kswapd retry counter but the more I am thiking about that the more your > patch makes sense to me.=20 >=20 > The reason being that it handles both memcg and global direct reclaims > in the same way which makes the logic easier to follow. Afterall the > primary purpose is to resurrect kswapd after we can see there is a > better chance to reclaim something for kswapd. Until that moment direct > reclaim is the only reclaim mechanism. >=20 >=20Relying on pgdat_balanced might lead to re-enabling kswapd way much > later while memory reclaim would be still mostly direct reclaim bound - > thus increase allocation latencies. > If we wanted to do better we would need to evaluate recent > refaults/thrashing behavior but even then I am not sure we can make a > good cut off. >=20 >=20So in the end pgdat_balanced approach seems worth trying and see whet= her > this could cause any corner cases. Thanks Michal. Regarding the allocation latency concern - we are already in the direct reclaim slowpath, so a little extra overhead from the pgdat_balanced check should be negligible. > --=20 >=20Michal Hocko > SUSE Labs >