Received: by 10.192.165.156 with SMTP id m28csp1956127imm; Thu, 12 Apr 2018 06:26:45 -0700 (PDT) X-Google-Smtp-Source: AIpwx48owBfGxG7A3ub1JrERz+/67QPOt4rui5hsp0ehylimljv6k62FBt8WG/zrtjG0vBFHAfK2 X-Received: by 10.99.143.30 with SMTP id n30mr727525pgd.213.1523539604955; Thu, 12 Apr 2018 06:26:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523539604; cv=none; d=google.com; s=arc-20160816; b=auLETc36e8dc0bPPrLt8Hd3UJwGB1P6KZlPaFxa9Ncp1W5U5ZO/wG4kQUpDzkE3dTx FIbP6l/3DoAg3I72Z1UAWlWe8BN6DzT0Sx/RNDuyd3SKK2LJsd2toxK+he7KN9KYOjTK bZIxwgALstShNZSpDXQKXK2B69WSAx4uI+CDL6cYupM3ebrpUQTDht2whyg26Hyh2b6D C2Fpwyc4TUeqeMVdJuuod1Cg9QojOTPnWbxzJsqKe8PL96XWGl6gzAmq4JjwPpOsdwPy BZ9QlbiKpAM+Oue7M1ebI8E+M56s/ZcTbAI+O9liu8SgorvQB84YPpey70RCb6+AU8mh wu1w== 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-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date :arc-authentication-results; bh=en33jEoc9SPOENQ020fkj5TNE0EAUtmo0ZFTVRyQR74=; b=posUcJGN3fV1qTIFsneT0vRp58x+5wVR/5lDOtYRMnQSl6MI16E/TsVPjjA1JOKuaV CEP82iH6pVTGOgmXW7Sfrs7bWRnuxEy6neJvYC5qHidoMQAlysupt5p0/bgQrjOioaVW Oml3YF0B8pbzxox+MWX12mH+39IEnflduFj/szQbZW3khfjWIl9s5EjFzeRsEMChEw/m MBsgeq1oxPhak7wsopjPfsUxWEDZGtYx4vJhWn6cmPP9CklttYDtMmXCDJIF21aKkRWX EBm0ivaMSBn8WIvI31jqEufuS9CQKy+Sc576VllbfhKIz6xhmoL06qFCEtlZYt6VXO5j O0xA== 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 7-v6si3313512pll.132.2018.04.12.06.26.07; Thu, 12 Apr 2018 06:26:44 -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 S1752571AbeDLNX2 (ORCPT + 99 others); Thu, 12 Apr 2018 09:23:28 -0400 Received: from mx2.suse.de ([195.135.220.15]:33533 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751448AbeDLNX1 (ORCPT ); Thu, 12 Apr 2018 09:23:27 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 3C7C0AC69; Thu, 12 Apr 2018 13:23:26 +0000 (UTC) Date: Thu, 12 Apr 2018 15:23:24 +0200 From: Michal Hocko To: Buddy Lumpkin Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, hannes@cmpxchg.org, riel@surriel.com, mgorman@suse.de, Matthew Wilcox , akpm@linux-foundation.org Subject: Re: [RFC PATCH 1/1] vmscan: Support multiple kswapd threads per node Message-ID: <20180412132324.GG23400@dhcp22.suse.cz> References: <1522661062-39745-1-git-send-email-buddy.lumpkin@oracle.com> <1522661062-39745-2-git-send-email-buddy.lumpkin@oracle.com> <20180403133115.GA5501@dhcp22.suse.cz> <502E8C16-DEA1-40A5-85CB-923E3ABE0B45@oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <502E8C16-DEA1-40A5-85CB-923E3ABE0B45@oracle.com> User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue 10-04-18 20:10:24, Buddy Lumpkin wrote: [...] > > Also please note that the direct reclaim is a way to throttle overly > > aggressive memory consumers. The more we do in the background context > > the easier for them it will be to allocate faster. So I am not really > > sure that more background threads will solve the underlying problem. > > A single kswapd thread used to keep up with all of the demand you could > create on a Linux system quite easily provided it didn’t have to scan a lot > of pages that were ineligible for eviction. Well, what do you mean by ineligible for eviction? Could you be more specific? Are we talking about pages on LRU list or metadata and shrinker based reclaim. > 10 years ago, Fibre Channel was > the popular high performance interconnect and if you were lucky enough > to have the latest hardware rated at 10GFC, you could get 1.2GB/s per host > bus adapter. Also, most high end storage solutions were still using spinning > rust so it took an insane number of spindles behind each host bus adapter > to saturate the channel if the access patterns were random. There really > wasn’t a reason to try to thread kswapd, and I am pretty sure there hasn’t > been any attempts to do this in the last 10 years. I do not really see your point. Yeah you can get a faster storage today. So what? Pagecache has always been bound by the RAM speed. > > It is just a matter of memory hogs tunning to end in the very same > > situtation AFAICS. Moreover the more they are going to allocate the more > > less CPU time will _other_ (non-allocating) task get. > > Please describe the scenario a bit more clearly. Once you start constructing > the workload that can create this scenario, I think you will find that you end > up with a mix that is rarely seen in practice. What I meant is that the more you reclaim in the background to more you allow memory hogs to allocate because they will not get throttled. All that on behalf of other workload which is not memory bound and cannot use CPU cycles additional kswapd would consume. Think of any computation intensive workload spreading over most CPUs and a memory hungry data processing. -- Michal Hocko SUSE Labs