Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp6626807ybe; Wed, 18 Sep 2019 06:37:28 -0700 (PDT) X-Google-Smtp-Source: APXvYqzIRrqMO3Qfx7ISH3DAHmx731zQQY6uIHGnMxqmASmZ+JDSgyGc9G82OTGyOmlCiEh3kufg X-Received: by 2002:a17:906:1f14:: with SMTP id w20mr9370233ejj.272.1568813848758; Wed, 18 Sep 2019 06:37:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568813848; cv=none; d=google.com; s=arc-20160816; b=GHTOAljXPAPrv7lOrqfqYec7dqoZBGl5eYncRQR2pIq1osip7jDZ7TuKDkNiYjV5y7 amfxn59pHOFQF2BueqzDcoX7C/+yH5GffD+YJz9rYKs2kckSOcohEfyjoyn0DwqBSWBo w+cKvl0ieIeW/ehrA0rq2JH9grlTy0+YHPtvF3Ujvqomw4hcxIRSjkqlSpi7krXLV1df YJRETIKtnOi7ud1nr1UPtpgSKZaZ6lbH24bQY/tENwWTulBN3kHcsgIpR3ibNNfrgvIw ZNcekhT48QJVTlRfZQnh6nVWFXKDKHty8/oCuxjMYLkJ6rVYk0OFp5BCdyexmwJ3WfsF JqNA== 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=dqo1Sf5iCZn8pQ7MCgyAPGGLeZFuZ5mj5dAqVFa8Ewo=; b=yKsd1uaKH2Bq4evVedLFseAnRLd0EjHlSov3xNIl4ul7qDdFHKZaP9SWyGUSgMsRVg tCCNqg/fkBXApXDW+vD+GXDDY5B/yRm6lXv5GLOT8c5oOoaxq4y/7sdvZsGlIPyskiDm 6dPEp5NMXXRemih1+bOICYBChYcCDjSFa/NsOfAvxeifQU20PF3UPa1Af1St05c/vkk8 0nhGSwNZ9lQQSsb4RvUWgi7+4f/ku9qPUco795ADgKGQ5zDG7lv7JOUi+7LWwAS3Dd50 R50cOxLfh7TdKGTx57cZZcoxHdDDK1RFLXT/tuob/MLNph42Tlv2csKG/qsgkvhFkK17 oP+g== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p18si3151910edx.185.2019.09.18.06.37.05; Wed, 18 Sep 2019 06:37:28 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731115AbfIRMdp (ORCPT + 99 others); Wed, 18 Sep 2019 08:33:45 -0400 Received: from mx2.suse.de ([195.135.220.15]:37612 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725902AbfIRMdo (ORCPT ); Wed, 18 Sep 2019 08:33:44 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 0E333AD4E; Wed, 18 Sep 2019 12:33:43 +0000 (UTC) Date: Wed, 18 Sep 2019 14:33:42 +0200 From: Michal Hocko To: Matthew Wilcox Cc: Lin Feng , corbet@lwn.net, mcgrof@kernel.org, akpm@linux-foundation.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, keescook@chromium.org, mchehab+samsung@kernel.org, mgorman@techsingularity.net, vbabka@suse.cz, ktkhai@virtuozzo.com, hannes@cmpxchg.org Subject: Re: [PATCH] [RFC] vmscan.c: add a sysctl entry for controlling memory reclaim IO congestion_wait length Message-ID: <20190918123342.GF12770@dhcp22.suse.cz> References: <20190917115824.16990-1-linf@wangsu.com> <20190917120646.GT29434@bombadil.infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190917120646.GT29434@bombadil.infradead.org> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue 17-09-19 05:06:46, Matthew Wilcox wrote: > On Tue, Sep 17, 2019 at 07:58:24PM +0800, Lin Feng wrote: [...] > > +mm_reclaim_congestion_wait_jiffies > > +========== > > + > > +This control is used to define how long kernel will wait/sleep while > > +system memory is under pressure and memroy reclaim is relatively active. > > +Lower values will decrease the kernel wait/sleep time. > > + > > +It's suggested to lower this value on high-end box that system is under memory > > +pressure but with low storage IO utils and high CPU iowait, which could also > > +potentially decrease user application response time in this case. > > + > > +Keep this control as it were if your box are not above case. > > + > > +The default value is HZ/10, which is of equal value to 100ms independ of how > > +many HZ is defined. > > Adding a new tunable is not the right solution. The right way is > to make Linux auto-tune itself to avoid the problem. I absolutely agree here. From you changelog it is also not clear what is the underlying problem. Both congestion_wait and wait_iff_congested should wake up early if the congestion is handled. Is this not the case? Why? Are you sure a shorter timeout is not just going to cause problems elsewhere. These sleeps are used to throttle the reclaim. I do agree there is no great deal of design behind them so they are more of "let's hope it works" kinda thing but making their timeout configurable just doesn't solve this at all. You are effectively exporting a very subtle implementation detail into the userspace. -- Michal Hocko SUSE Labs