Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp124946ybz; Thu, 30 Apr 2020 17:51:29 -0700 (PDT) X-Google-Smtp-Source: APiQypJ7MJJeGrJFZQ8zgkn2QbHWjWAnBYogKfnS+C+LRyfxWLRrGo6rxQDlu1IvhbT9/cZ+gBEP X-Received: by 2002:a17:906:1cd5:: with SMTP id i21mr1049974ejh.251.1588294289495; Thu, 30 Apr 2020 17:51:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588294289; cv=none; d=google.com; s=arc-20160816; b=qsrxHc9DSryjL8FYLncl4Ce1NAJYEShXtGhcLRkz9vYfR9mR21XWBc0JChs7lH5fz0 RLD5sTnIkE2lRr2CyiJB19PlnunztGOZxqZk4PM8qZU/QasVMLM02wz61wb5alVGVhQv GcQbrBxsfreg+GGmHTfUSH4D96eKb1jKOKHdf7iiaJwN33RyiDQ5aWbBX1Nvl+oze2x7 eYGV7xcqfZfMURKHod/Bnpnt6H8TQMoYtpGBHBOrNc1ob3YmEkeU/o7LUX2Mi4fPV0CI 5rZIoxSUNCS4c6asr+dk/olYuBk2Lv2qwlkQHRepOnduRwOVSZrEx9lMPbI6LtJJXOpf VvwA== 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; bh=LgvJdRi8hFMvNPNpK1kP0zQ8O6+hIX2Kz3HJb7hO6MM=; b=Q9NItu25zEGGrb01ATBjkJZQQbS3B1FzSO9TOthc5hgo85hcvq7aJHMbbshd+yhmoG H0hu/FBJzl0qyuxF0TKwUfcbOcY2Xwrw7cFoYxQ7A1GzMfU+xzzUY2ervODCe0u8T3VH JUReUlbt63Q0piZamuFG0Q6gdROfPPaMGe1D/RGwWzlJOEFDxpwNLuoMdvFeeyNdb5BR 5sxPhqMgbIc6CREqjNobakAJ+ORxPlkrNsAi4YYVUNkzMDxNqviA2+vLbXW7E9zRa14D bZUUSQy1gD5IfzB6OjvNhp4E6qRhEdXw2F2EydpQmFmEAbUd0fQH7pRTWC7LC5GTqO8j B5Bg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-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 fi25si887380ejb.25.2020.04.30.17.50.54; Thu, 30 Apr 2020 17:51:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727124AbgEAAun (ORCPT + 99 others); Thu, 30 Apr 2020 20:50:43 -0400 Received: from relay9-d.mail.gandi.net ([217.70.183.199]:56167 "EHLO relay9-d.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726384AbgEAAun (ORCPT ); Thu, 30 Apr 2020 20:50:43 -0400 X-Originating-IP: 50.39.163.217 Received: from localhost (50-39-163-217.bvtn.or.frontiernet.net [50.39.163.217]) (Authenticated sender: josh@joshtriplett.org) by relay9-d.mail.gandi.net (Postfix) with ESMTPSA id 4F0B7FF805; Fri, 1 May 2020 00:50:28 +0000 (UTC) Date: Thu, 30 Apr 2020 17:50:26 -0700 From: Josh Triplett To: Andrew Morton Cc: Daniel Jordan , Herbert Xu , Steffen Klassert , Alex Williamson , Alexander Duyck , Dan Williams , Dave Hansen , David Hildenbrand , Jason Gunthorpe , Jonathan Corbet , Kirill Tkhai , Michal Hocko , Pavel Machek , Pavel Tatashin , Peter Zijlstra , Randy Dunlap , Shile Zhang , Tejun Heo , Zi Yan , linux-crypto@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 0/7] padata: parallelize deferred page init Message-ID: <20200501005026.GA104377@localhost> References: <20200430201125.532129-1-daniel.m.jordan@oracle.com> <20200430143131.7b8ff07f022ed879305de82f@linux-foundation.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200430143131.7b8ff07f022ed879305de82f@linux-foundation.org> Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org On Thu, Apr 30, 2020 at 02:31:31PM -0700, Andrew Morton wrote: > On Thu, 30 Apr 2020 16:11:18 -0400 Daniel Jordan wrote: > > Sometimes the kernel doesn't take full advantage of system memory > > bandwidth, leading to a single CPU spending excessive time in > > initialization paths where the data scales with memory size. > > > > Multithreading naturally addresses this problem, and this series is the > > first step. > > > > It extends padata, a framework that handles many parallel singlethreaded > > jobs, to handle multithreaded jobs as well by adding support for > > splitting up the work evenly, specifying a minimum amount of work that's > > appropriate for one helper thread to do, load balancing between helpers, > > and coordinating them. More documentation in patches 4 and 7. > > > > The first user is deferred struct page init, a large bottleneck in > > kernel boot--actually the largest for us and likely others too. This > > path doesn't require concurrency limits, resource control, or priority > > adjustments like future users will (vfio, hugetlb fallocate, munmap) > > because it happens during boot when the system is otherwise idle and > > waiting on page init to finish. > > > > This has been tested on a variety of x86 systems and speeds up kernel > > boot by 6% to 49% by making deferred init 63% to 91% faster. > > How long is this up-to-91% in seconds? If it's 91% of a millisecond > then not impressed. If it's 91% of two weeks then better :) Some test results on a system with 96 CPUs and 192GB of memory: Without this patch series: [ 0.487132] node 0 initialised, 23398907 pages in 292ms [ 0.499132] node 1 initialised, 24189223 pages in 304ms ... [ 0.629376] Run /sbin/init as init process With this patch series: [ 0.227868] node 0 initialised, 23398907 pages in 28ms [ 0.230019] node 1 initialised, 24189223 pages in 28ms ... [ 0.361069] Run /sbin/init as init process That makes a huge difference; memory initialization is the largest remaining component of boot time. > Relatedly, how important is boot time on these large machines anyway? > They presumably have lengthy uptimes so boot time is relatively > unimportant? Cloud systems and other virtual machines may have a huge amount of memory but not necessarily run for a long time; on such systems, boot time becomes critically important. Reducing boot time on cloud systems and VMs makes the difference between "leave running to reduce latency" and "just boot up when needed". - Josh Triplett