Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp1072226ybt; Fri, 26 Jun 2020 20:14:29 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwcPU/8NAn0G3O6ZqHB0t4aTX1qpl0YwYCHsbu1eqak2gT+C3BH3OEFYrpvjfEzuyCuXuHL X-Received: by 2002:a17:906:a055:: with SMTP id bg21mr764147ejb.516.1593227669342; Fri, 26 Jun 2020 20:14:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593227669; cv=none; d=google.com; s=arc-20160816; b=MOCNPm8+6j0sN5kTBW2ENLZ2Akfc1I6jh8YmtnnyTD7JBOOrNYaldZY/H/Ub9cHUHD Jn7ch3wMsdh+eSReLeLqrKANi55fSGO0ejYokPUoosT6amJn8Q3Cj2GcVSs6TIBq0fer Bwv53RJERYyO5ozbe/WATcehjxoGtyElmxogDXH5vIbFkwVjQmTg485DLayE7rduBzTU r5YpiyiQ3kbPTU9l6IICw1uNuB4JB8pjdudTGs9fUOc29MgohVazdvf4WeO5ZKB/cN0n DFnwnEn/WLLAE64HralZDddR2u+omuYDMe/VjYlCVOP+HO4h4u7F/8x4VvNkx8tutMCA 2c/g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=0qSzBJi+XuKj7CRmKywfW9dDWMGYScdJeNBfiOOZ+Go=; b=QDqw9rkx8r7YtBwkmuU28yyrujC46JA4ZvzD8xTA1SoHI5p0pDWC/2UUJV53x8hSJP 7TlguYt5BEPONd6omy+n3ZhIH4eIZ8xtasrz09iB/ShmqTcTxnHhr7oAbyAN6OPQSWPy UsFyD99uTmi/PwN5IMo90ewTobDwd9lcEnVuqWU9SpqzSJqoHQPXy58/2FLmZt9PNR5i ebBShUrvJw7Ktsil7rNL7/ZdugVrFr87IL8ytNTkO14DHcY9XaV7umUK5r8Td9xzWw9w 4PXFJhsPmpzTcJ5DNVhuiqvAG7WYhbsxN7ICpWfkpBeawNSwiABGIUEnyca6R0bLj5aa 1osQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=casper.20170209 header.b=Zoz0O+Fe; 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 e12si4341315edy.476.2020.06.26.20.14.06; Fri, 26 Jun 2020 20:14:29 -0700 (PDT) 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=fail header.i=@infradead.org header.s=casper.20170209 header.b=Zoz0O+Fe; 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 S1725882AbgF0DNk (ORCPT + 99 others); Fri, 26 Jun 2020 23:13:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48136 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725828AbgF0DNk (ORCPT ); Fri, 26 Jun 2020 23:13:40 -0400 Received: from casper.infradead.org (unknown [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 371CBC03E979 for ; Fri, 26 Jun 2020 20:13:40 -0700 (PDT) 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=0qSzBJi+XuKj7CRmKywfW9dDWMGYScdJeNBfiOOZ+Go=; b=Zoz0O+FeBjpB00KsH/icqN4hlA bJvQZcDlrmgrAAP+E7FTJFMzV8OXmiIF5uNvDaTR5pYc+7aidJbIdhZ9qZGPXa3hUg8JtBikKkR5b vUEjtn5eZB7T4+4RbDgZM6G47Ca7v7iXnfi21tBTlKuZ9mhz57aHn+vusYzH9YEalhcd+mwp3eG2U 3TQDdl4RdR3bAH8A/1ChoWYiaHHBnNeTeGDGYNBPJlJWO5WrBay4wBMWhIKy1V5Du5Bt7WfsC75cH V8U0xLXF7bXbp5Ktg8Ku3T00ZTjJLp8hq//BgLqZ93NfBNEHqujQpSdtXWVl6I7+cPTNID85wTkNz dkXWi78w==; Received: from willy by casper.infradead.org with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1jp1H7-0006RJ-0j; Sat, 27 Jun 2020 03:13:05 +0000 Date: Sat, 27 Jun 2020 04:13:04 +0100 From: Matthew Wilcox To: Tim Chen Cc: Andrew Morton , Vladimir Davydov , Johannes Weiner , Michal Hocko , Dave Hansen , Ying Huang , linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [Patch] mm: Increase pagevec size on large system Message-ID: <20200627031304.GC25039@casper.infradead.org> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jun 26, 2020 at 02:23:03PM -0700, Tim Chen wrote: > Enlarge the pagevec size to 31 to reduce LRU lock contention for > large systems. > > The LRU lock contention is reduced from 8.9% of total CPU cycles > to 2.2% of CPU cyles. And the pmbench throughput increases > from 88.8 Mpages/sec to 95.1 Mpages/sec. The downside here is that pagevecs are often stored on the stack (eg truncate_inode_pages_range()) as well as being used for the LRU list. On a 64-bit system, this increases the stack usage from 128 to 256 bytes for this array. I wonder if we could do something where we transform the ones on the stack to DECLARE_STACK_PAGEVEC(pvec), and similarly DECLARE_LRU_PAGEVEC the ones used for the LRUs. There's plenty of space in the header to add an unsigned char sz, delete PAGEVEC_SIZE and make it an variable length struct. Or maybe our stacks are now big enough that we just don't care. What do you think?