From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out30-101.freemail.mail.aliyun.com (out30-101.freemail.mail.aliyun.com [115.124.30.101]) (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 72B091D54FE for ; Fri, 11 Jul 2025 06:10:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=115.124.30.101 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1752214216; cv=none; b=X4QkOeV12WeACSbGN9nZefSpPe9aptAW7yGCQbUcVW/f757TsTZTZB4el9EoyjwUGfELfJ0cDHKs36w/Ho7HUn7uPrYl96L/Y1a17gZRWFWbaYvNU+mgJB+kX5iKXzRcr7mWJ5bNKhLt26sFbGoSM6jLhF9uT59N84QURnHzWlc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1752214216; c=relaxed/simple; bh=MxK4UIQDMHRZzOzYbMfO57exppis0GDO31/E3L0QhYY=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=JS8Beh56PTcqFmbajSjldevN+OsMrI/5IQ2QPqkMUhIw30wTJjjbytJqTOYdJsjF58WYXlvELE1m11WFW9uhINcOhqM8+/DAMyOej3TVHQuurwowAMJQWWcIS4ZvZmjNC1l7pcTK/GyS0NoUsNKEuRRh3hFbegQ/FUglflLWw9c= 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=sbquC2wX; arc=none smtp.client-ip=115.124.30.101 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="sbquC2wX" DKIM-Signature:v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.alibaba.com; s=default; t=1752214203; h=Message-ID:Date:MIME-Version:Subject:To:From:Content-Type; bh=GviDtt0HM/H/nsHgI4GLwCPioqjPub/0QBTaXoqCufk=; b=sbquC2wXrOYC1Ddcq4iguxQOZusYoRS+zo2fBN91WaBK2nS6nlbBJDc7bBB583d09Lyud+mfcif0TRGPQtCBRMckk9jJUik1jmff7wAoZNzcOPyIh5H3JM4ZvFxByWsowJ/NKkfSnD15MJTQYlIf1Ku+x36ZnyjXiRExldHQiec= Received: from 30.74.144.131(mailfrom:baolin.wang@linux.alibaba.com fp:SMTPD_---0WifmNlO_1752214200 cluster:ay36) by smtp.aliyun-inc.com; Fri, 11 Jul 2025 14:10:01 +0800 Message-ID: <1fe97413-03eb-433a-91b3-b53e58c65622@linux.alibaba.com> Date: Fri, 11 Jul 2025 14:10:00 +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 v5 5/8] mm/shmem, swap: never use swap cache and readahead for SWP_SYNCHRONOUS_IO To: Kairui Song , linux-mm@kvack.org Cc: Andrew Morton , Hugh Dickins , Matthew Wilcox , Kemeng Shi , Chris Li , Nhat Pham , Baoquan He , Barry Song , linux-kernel@vger.kernel.org References: <20250710033706.71042-1-ryncsn@gmail.com> <20250710033706.71042-6-ryncsn@gmail.com> From: Baolin Wang In-Reply-To: <20250710033706.71042-6-ryncsn@gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 2025/7/10 11:37, Kairui Song wrote: > From: Kairui Song > > For SWP_SYNCHRONOUS_IO devices, if a cache bypassing THP swapin failed > due to reasons like memory pressure, partially conflicting swap cache > or ZSWAP enabled, shmem will fallback to cached order 0 swapin. > > Right now the swap cache still has a non-trivial overhead, and readahead > is not helpful for SWP_SYNCHRONOUS_IO devices, so we should always skip > the readahead and swap cache even if the swapin falls back to order 0. > > So handle the fallback logic without falling back to the cached read. > > Signed-off-by: Kairui Song LGTM. Thanks. Reviewed-by: Baolin Wang