From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 18CBCC433EF for ; Thu, 7 Oct 2021 19:31:13 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id C4B836113E for ; Thu, 7 Oct 2021 19:31:12 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org C4B836113E Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=linux-foundation.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id 1963E6B006C; Thu, 7 Oct 2021 15:31:12 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 146196B0071; Thu, 7 Oct 2021 15:31:12 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 033F8900002; Thu, 7 Oct 2021 15:31:11 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0230.hostedemail.com [216.40.44.230]) by kanga.kvack.org (Postfix) with ESMTP id E49536B006C for ; Thu, 7 Oct 2021 15:31:11 -0400 (EDT) Received: from smtpin03.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 93C3C8249980 for ; Thu, 7 Oct 2021 19:31:11 +0000 (UTC) X-FDA: 78670634742.03.93AD86C Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by imf16.hostedemail.com (Postfix) with ESMTP id 3B051F001386 for ; Thu, 7 Oct 2021 19:31:11 +0000 (UTC) Received: by mail.kernel.org (Postfix) with ESMTPSA id 2884B610A1; Thu, 7 Oct 2021 19:31:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1633635070; bh=HhBYKDk4QK9bVPwS4vHzeRTACL3GE5kSGSANE9D2jDI=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=f/VRG6xnT6Dq+L4jU0SQ/soGHSTlTjZ//IS9sLzBRv7xdr0ozOPlFIBw9M/vZWbM+ pAhgoWYfnVvlAHsBV2jAgVgqygOx+u2pOsxO7bZ6k3wkVQf2EyH6ueGpmEg7DVcqCl 8OggsvvlADcMDGz51XHBamkZfn3Q2oEsOUCurqmI= Date: Thu, 7 Oct 2021 12:31:09 -0700 From: Andrew Morton To: "Matthew Wilcox (Oracle)" Cc: Mel Gorman , linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2] mm: Optimise put_pages_list() Message-Id: <20211007123109.6a49c7c625e414acf7546c89@linux-foundation.org> In-Reply-To: <20211007192138.561673-1-willy@infradead.org> References: <20211007192138.561673-1-willy@infradead.org> X-Mailer: Sylpheed 3.5.1 (GTK+ 2.24.31; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: 3B051F001386 X-Stat-Signature: dpdz6r4pxhjfuux3ggk71c9oxhyp4uid Authentication-Results: imf16.hostedemail.com; dkim=pass header.d=linux-foundation.org header.s=korg header.b="f/VRG6xn"; spf=pass (imf16.hostedemail.com: domain of akpm@linux-foundation.org designates 198.145.29.99 as permitted sender) smtp.mailfrom=akpm@linux-foundation.org; dmarc=none X-HE-Tag: 1633635071-698440 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Thu, 7 Oct 2021 20:21:37 +0100 "Matthew Wilcox (Oracle)" wrote: > Instead of calling put_page() one page at a time, pop pages off > the list if their refcount was too high and pass the remainder to > put_unref_page_list(). This should be a speed improvement, but I have > no measurements to support that. Current callers do not care about > performance, but I hope to add some which do. Don't you think it would actually be slower to take an additional pass across the list? If the list is long enough to cause cache thrashing. Maybe it's faster for small lists.