From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) (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 226D71DA5F for ; Thu, 2 Jan 2025 13:10:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=90.155.50.34 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1735823422; cv=none; b=uH7zVTo80qyK/vpQJ5cWm8Pb9QS8QRBuCwbGX7f2KK+zPPl5rXRzNnghT6n+J7m04oCvuyWdAgXSdtLIeKI6Ufx3QAEyiPWPyADXxb9xd+e6Pm1HDd8/fQz4JXajau3j5NU7LOdtOAeHGJrWsTY8K8U4FySCBOMSYTjcEQsKbYk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1735823422; c=relaxed/simple; bh=EQPrnIEdcPnWZoljaPcE2oGT1/CG9zoUnfdtkF0JIpo=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=kWVIIzWjDr/tEhj+vaPiByvfO9XUws+KFKnxg/0cNyk8yHkV+9vfizA2sCXcTNcYQirEXK8doya9ypngLVdiAwdit4t0Q3FWcoRyxHjhcnHz04+mjSiehAy2u1LVBjZh90kCEvlugza+wdQe24ob0WsXGe/sJCDgsXqUJumCYB0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org; spf=none smtp.mailfrom=infradead.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b=S00feGsy; arc=none smtp.client-ip=90.155.50.34 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=infradead.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="S00feGsy" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=3xOmDBe6+7NeGLuKMOGc6Aa5TB/fwk2j0lshQiTLtH4=; b=S00feGsyT1nVmCnBOyPKpepmTA 4sJO0kWrJVHjDLSt+sRyxJhvNveaw43QwbTPFXm1bJSPaGQztBNs3ITqy23TQDg5l6UF/cHmGNccX tdCsF2g+h9VbbOpDTN/MQWdomefDKaobp5ndOPBZ0Uidb+8tNb0eOQ8R+Iamx5E5F1ELs4Crn8WS4 heIxFiomL/vLVpzlIQRL7ZgWI8CmwPEL/7PaeXIn2Fowus1vDxiCyV3PUCoc+jysHA2YzMhzN53IJ 8M46QNOncGBAgIV2W9A3xK60qYx6B5pvG15BbyinPFnNQTeX6r7M1ZdTR9VTdGMMKJ/DCpzKFN1Jj Qx7JM0Dg==; Received: from willy by casper.infradead.org with local (Exim 4.98 #2 (Red Hat Linux)) id 1tTKxe-0000000Gopk-18x6; Thu, 02 Jan 2025 13:10:02 +0000 Date: Thu, 2 Jan 2025 13:10:02 +0000 From: Matthew Wilcox To: Baolin Wang Cc: akpm@linux-foundation.org, hughd@google.com, david@redhat.com, wangkefeng.wang@huawei.com, kasong@tencent.com, ying.huang@linux.alibaba.com, 21cnbao@gmail.com, ryan.roberts@arm.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2] mm: shmem: skip swapcache for swapin of synchronous swap device Message-ID: References: <04997e54c276eff40a6119a90d36a4e71aade89c.1735806921.git.baolin.wang@linux.alibaba.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <04997e54c276eff40a6119a90d36a4e71aade89c.1735806921.git.baolin.wang@linux.alibaba.com> On Thu, Jan 02, 2025 at 04:40:17PM +0800, Baolin Wang wrote: > With fast swap devices (such as zram), swapin latency is crucial to applications. > For shmem swapin, similar to anonymous memory swapin, we can skip the swapcache > operation to improve swapin latency. OK, but now we have more complexity. Why can't we always skip the swapcache on swapin? (Actually, I think we can always skip the swapcache on swapout too, but that's a different matter). > +static struct folio *shmem_swap_alloc_folio(struct inode *inode, struct vm_area_struct *vma, > + pgoff_t index, swp_entry_t entry, int order, gfp_t gfp) Please wrap at 80 columns and use two tabs for indenting subsequent lines. ie: static struct folio *shmem_swap_alloc_folio(struct inode *inode, struct vm_area_struct *vma, pgoff_t index, swp_entry_t entry, int order, gfp_t gfp)