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 E20CA1BC4E for ; Thu, 23 Jan 2025 18:17:33 +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=1737656255; cv=none; b=dDStTCIjz2FBkOGdjsK55zooh8UTXeb7eF0GXg5ysT0dfurUZEixspjDU/VvLyWWf533zF0kG3BpGfM4bRADIEHXDpshQmkiwXQdYiiX0j348F3QQXUu4jEp45h7H3ecEPQ6DC65HxAkGh65nz34aJY6gn1OILK/NIwa9hwzcTU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737656255; c=relaxed/simple; bh=f+J/lEiSdsVRsc7kXW0r5NeJcc0YXu2NzXe6WaT5RJ0=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=bHRwKuqXekmiiXEEi19wae678LgtoHLWIkidZIX3CKdw7bu961wSVZVWK0dfGdh+7GEwnXrL5KE8F6XnKg/9enIFAa0BU3IOjDvsaOJhUAY8X49+m5Z5URtRGiP20za1grN5m0I/foSdzMKEcQVfllN76pPnPOygW6c1g5OdT84= 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=j6h0uqZR; 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="j6h0uqZR" 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=6RlamGXDFH1gohTV3W5UR1gIegITWX6ZOpHuLjIBVPg=; b=j6h0uqZRYImrGCU87MimI8WcxT GLTlpjZKMAxSTqLg+kSZ5GXwNWpfDqTevuSnHxqkW7Bz92KDQvX+8H6NR231b4kpjLAQty1q8EdfD qtz2ryB72Y554q+nQGGfyrSc6JuoSieNPR3CzGCJiJcEpaKheFhqKbNj551LtfJgJwsOYrlVbfhs4 tsAPdY2N03Dj4Jdkc1ivwkpt/2+HTtFWroU2kL9PRUVwOArY5h2scdTvSribMxMStmXiObQjTG5jQ WuLvPWTfjTD/cOOsILq8v/0o0SX6yUVS81g8mayEOjH5k+Y1hDKB9vBp3D0U0AgkXyiyYkAnfdZNU oeIjHGQg==; Received: from willy by casper.infradead.org with local (Exim 4.98 #2 (Red Hat Linux)) id 1tb1lb-00000009ujM-2Daq; Thu, 23 Jan 2025 18:17:23 +0000 Date: Thu, 23 Jan 2025 18:17:23 +0000 From: Matthew Wilcox To: Vinay Banakar Cc: SeongJae Park , Bharata B Rao , linux-mm@kvack.org, linux-kernel@vger.kernel.org, akpm@linux-foundation.org, mgorman@suse.de, Wei Xu , Greg Thelen Subject: Re: [PATCH] mm: Optimize TLB flushes during page reclaim Message-ID: References: <20250122200545.43513-1-sj@kernel.org> 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: On Thu, Jan 23, 2025 at 11:11:13AM -0600, Vinay Banakar wrote: > Another option would be to modify shrink_folio_list() to force batch > flushes for up to N pages (512) at a time, rather than relying on > callers to do the batching via folio_list. If you really want to improve performance, consider converting shrink_folio_list() to take a folio_batch. I did this for page freeing: https://lore.kernel.org/all/20240227174254.710559-1-willy@infradead.org/ and we did in fact see a regression (due to shrinking the batch size from 32 to 15). We then increased the batch size from 15 to 31 and saw a 12.5% performance improvement on the page_fault2 benchmark over the original batch size of 32. Commit 9cecde80aae0 and https://lore.kernel.org/oe-lkp/202403151058.7048f6a8-oliver.sang@intel.com/ have some more details. I think you should be able to see a noticable improvement by going from a list with 512 entries on it to a batch of 31 entries.