Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp254415ybe; Thu, 12 Sep 2019 19:34:45 -0700 (PDT) X-Google-Smtp-Source: APXvYqyEkEKBJbYV0FCSErks9M+P8FSWlymzx196JAIL1KVWwHBdcbAA23MaHeyy37/dUDgUwt6A X-Received: by 2002:a17:906:a851:: with SMTP id dx17mr37716366ejb.116.1568342085736; Thu, 12 Sep 2019 19:34:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568342085; cv=none; d=google.com; s=arc-20160816; b=qq6JdBs6r+LCfktQbLP/iWZTQ66zwZo1B+42zpJvvfrVMCNF0WyTn8gk9Gi72MIcN/ kKMKXA5idKm4onBpM90cDNnfFdrvHG+JF8yXNOJWis030I3bm6SbICff3AAl2bjShNAl Ada4ClQSEEE3sA5RKXBz0NF8hetDkRJ3nuDopW4reuclqm6EY+GpQ3HZKxmw99cy87VQ i6oiN4i7+COqX5QKPfGbIQmFn9beMw/kc8Vfd4ORSPJ3PhQKhh1TiG+9/n4XVRWeHt1d J/ftzC4eVevKzOKOM+QaTWnC1EKyw0DQoI2dvtgu7YPW/UiCQ0skokv/Z6kEuE9y83LS rCYA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=xnxyFv0Lvt1ddU5ADKTwrUrrwpn2kGvhl53zirn+gUc=; b=wWDBS2aKyudaIPXWATmdujlh1IHNaKVbvfW9bUsKZ92APZVC+eyBc91cdFVGX9ul8q eJRoEfxaRWLpmhuFvcgulaEtMyZclTHomRf5Om//QyddSq3ej3+cejuxlX8BiYYe5LCc u12A2cLYf2K1LbP69G02n1O/o8UpgQ5ttrqHz4PSsZdGFelAYZm5Wz9gT9K50rBEVW2o Ve/C60qghlBZtly5BolbDfQzxV2ffzY6MBoDUnLHpM/O6J8+vJYMGSSMCgJVHtSiONr/ WpwAXw1Z2pAwfPvg7D/Purh1Z8nQpqC0618s3HSE0076cfGKKxhxVEk8+JcFCiUBY/bm 8eWA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l3si6337551edq.115.2019.09.12.19.34.20; Thu, 12 Sep 2019 19:34:45 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726496AbfIMBux (ORCPT + 99 others); Thu, 12 Sep 2019 21:50:53 -0400 Received: from mail104.syd.optusnet.com.au ([211.29.132.246]:45439 "EHLO mail104.syd.optusnet.com.au" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725775AbfIMBux (ORCPT ); Thu, 12 Sep 2019 21:50:53 -0400 Received: from dread.disaster.area (pa49-181-255-194.pa.nsw.optusnet.com.au [49.181.255.194]) by mail104.syd.optusnet.com.au (Postfix) with ESMTPS id B6C1643ECC3; Fri, 13 Sep 2019 11:50:45 +1000 (AEST) Received: from dave by dread.disaster.area with local (Exim 4.92.2) (envelope-from ) id 1i8ajT-0000Fl-KL; Fri, 13 Sep 2019 11:50:43 +1000 Date: Fri, 13 Sep 2019 11:50:43 +1000 From: Dave Chinner To: Waiman Long Cc: Peter Zijlstra , Ingo Molnar , Will Deacon , Alexander Viro , Mike Kravetz , linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, Davidlohr Bueso Subject: Re: [PATCH 0/5] hugetlbfs: Disable PMD sharing for large systems Message-ID: <20190913015043.GF27547@dread.disaster.area> References: <20190911150537.19527-1-longman@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190911150537.19527-1-longman@redhat.com> User-Agent: Mutt/1.10.1 (2018-07-13) X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.2 cv=D+Q3ErZj c=1 sm=1 tr=0 a=YO9NNpcXwc8z/SaoS+iAiA==:117 a=YO9NNpcXwc8z/SaoS+iAiA==:17 a=jpOVt7BSZ2e4Z31A5e1TngXxSK0=:19 a=kj9zAlcOel0A:10 a=J70Eh1EUuV4A:10 a=7-415B0cAAAA:8 a=n3o9mYiGlt67Pqr9hHAA:9 a=CjuIK1q_8ugA:10 a=biEYGPWJfzWAr4FL6Ov7:22 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Sep 11, 2019 at 04:05:32PM +0100, Waiman Long wrote: > A customer with large SMP systems (up to 16 sockets) with application > that uses large amount of static hugepages (~500-1500GB) are experiencing > random multisecond delays. These delays was caused by the long time it > took to scan the VMA interval tree with mmap_sem held. > > To fix this problem while perserving existing behavior as much as > possible, we need to allow timeout in down_write() and disabling PMD > sharing when it is taking too long to do so. Since a transaction can > involving touching multiple huge pages, timing out for each of the huge > page interactions does not completely solve the problem. So a threshold > is set to completely disable PMD sharing if too many timeouts happen. > > The first 4 patches of this 5-patch series adds a new > down_write_timedlock() API which accepts a timeout argument and return > true is locking is successful or false otherwise. It works more or less > than a down_write_trylock() but the calling thread may sleep. Just on general principle, this is a non-starter. If a lock is being held too long, then whatever the lock is protecting needs fixing. Adding timeouts to locks and sysctls to tune them is not a viable solution to address latencies caused by algorithm scalability issues. Cheers, Dave. -- Dave Chinner david@fromorbit.com