Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp643951pxu; Thu, 26 Nov 2020 07:59:25 -0800 (PST) X-Google-Smtp-Source: ABdhPJzsYtIxuR71OsCCgqWq7ExVg+NkZasFGfWaMxISSP+Tmhv5yrFnmiFoIn1ALajJNQi8deMB X-Received: by 2002:a17:906:a292:: with SMTP id i18mr3120557ejz.257.1606406365255; Thu, 26 Nov 2020 07:59:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606406365; cv=none; d=google.com; s=arc-20160816; b=hDtPaV/+6NzT45YyrI7OVVIIIRLJZPtM2+drWTOR6gfU8V1Oh6fZgoC/ptmdb6n024 R1Ya13SvxyMDiEwMRH37SSOCPF/Cw+DVWmJ+SFr6puMJiNHeMRFt2wGdIcq3ajouuvIx U7zB62UOByKYI+h/oLq3P6usdz5JZ77v+hNQ4VBiaQXLChb02bfYMXXKa28erxU984M2 oWbqA3zT2qyumOO60K0CfIeh2mfsI0unzYNKQVjRc1/4rMgg0ynjATd8P/CsdZVTILDj 4t3iDY6jfDW1OxaihHBeC1egEJcu1Sb/IvfxCaig0rX3uIdvb+89y4EkVzV4SlKYqEFg Xcyg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=Qz4o1lO69kgW02RmX+EDGr87UNMxuLYtFUOYFYrec8c=; b=DslG1+LXcGl938jXI/RfDjyic8QMrahL7KRgz90Zea3XNwMUfldxuhtQZw/Tm4pjfL dM48jwoEWtkRHLgbStNyk3aqMho26/W/phCIoWCa3ZBEsfBPLFVnc1i/9mPV6lY/Zbgt QvmoWAc9+pinFgWHPFSAD3XHr7w88fv1S1k1BObi6aKfUObybzX1qVyEkKAaPXMJhrQm B3aD4Hi04wPOAx0amuq1NPOw1YSS6xw6NNRQsPuC3Dwrd880Ypu8L53Vd9HkPqKBL/pN 3OgbT35YTbzxr40lYhq0lUeOqf6u5I5X14ecP2ocgWI+pRiSwO4V1V7WzgxDuwDqgH6b Nd8w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=VPOLJXTx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l14si3413120edq.543.2020.11.26.07.59.02; Thu, 26 Nov 2020 07:59:25 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=VPOLJXTx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2403914AbgKZP4K (ORCPT + 99 others); Thu, 26 Nov 2020 10:56:10 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51426 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2391496AbgKZP4K (ORCPT ); Thu, 26 Nov 2020 10:56:10 -0500 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EDE73C0613D4 for ; Thu, 26 Nov 2020 07:56:09 -0800 (PST) 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=Qz4o1lO69kgW02RmX+EDGr87UNMxuLYtFUOYFYrec8c=; b=VPOLJXTxQnz/Knjtl/blwvOkoG VylHSRv9gdJNTpdLzdXbVUt/ajOlUiXFNWLm0bFErMrUWmTiE7OwmLWmMS98pTIzhZXABsivIWc4j RK+/ADZI9JHg6VPlinBCXRJ6SLXGqj3uEejJXxLXlGV8srF0bUN677DEIbDeeu5ofjju0EPNdOvRm apMHdTUkCkp9CyZ1LoSHYiG19wpwsKVVYQd/vnw8jL8yS5IGiPHiMoqZ29N90qrc3xCKWUMIMRSHZ WHCfPlWO8YE+ZtVDnzQj69Uq+THybVy463Z/gaRyjE34ms/77I3nYgDkdQ30TjZYgEEohJWPaBE+T 3XmIdxmg==; Received: from willy by casper.infradead.org with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1kiJcf-0007k5-OK; Thu, 26 Nov 2020 15:55:53 +0000 Date: Thu, 26 Nov 2020 15:55:53 +0000 From: Matthew Wilcox To: Vlastimil Babka Cc: Yu Zhao , Alex Shi , Konstantin Khlebnikov , Andrew Morton , Hugh Dickins , Michal Hocko , linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH next] mm/swap.c: reduce lock contention in lru_cache_add Message-ID: <20201126155553.GT4327@casper.infradead.org> References: <1605860847-47445-1-git-send-email-alex.shi@linux.alibaba.com> <20201126045234.GA1014081@google.com> <20201126072402.GA1047005@google.com> <464fa387-9dfd-a8c7-3d86-040f26fd4115@suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Nov 26, 2020 at 04:44:04PM +0100, Vlastimil Babka wrote: > However, Matthew wanted to increase pagevec size [1] and once 15^2 becomes > 63^2, it starts to be somewhat more worrying. > > [1] https://lore.kernel.org/linux-mm/20201105172651.2455-1-willy@infradead.org/ Well, Tim wanted it ;-) I would suggest that rather than an insertion sort (or was it a bubble sort?), we should be using a Shell sort. It's ideal for these kinds of smallish arrays. https://en.wikipedia.org/wiki/Shellsort