Received: by 10.213.65.68 with SMTP id h4csp3043imn; Tue, 3 Apr 2018 14:14:58 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/LdmHISkxmM6fnpWCTTNoI1EZNyo5icyJi+hxPI0ldpkcdgnuQPWhgGswPsmb2Gg6aPmsx X-Received: by 2002:a17:902:1c1:: with SMTP id b59-v6mr15693356plb.325.1522790098795; Tue, 03 Apr 2018 14:14:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522790098; cv=none; d=google.com; s=arc-20160816; b=OK85RlElnmJ4FnNX5reQC2bQGBhyw9s6PxiykWFNkr85cbbtGwT/fBeiWjAEXHn2gF /vva4RhBIsHlbbXS/5MpAZc+b1qHZi4FJH/nwBnurCIyy3HvlsOBwe1c4pu9S8JlEn8i cIUeJ1wMkxV+SxXxQFg+oACDDJWqPdeWlIWPND1zjyA7zjWfYKbCLsnAJyuuT60hFHJr Bt6X/OIO2U+fqWASjfqkuMYJSQAcgVnUFPupfXPYM3inVjk4SHj4RTPdaZMT6f4aq4V8 CD3SHOjjEOGLzbwShnP4IZjFUS8It3OjP/udSSxZcJen9nVoA5EKIymwncD+0ecpmPWH K8BA== 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:dkim-signature :arc-authentication-results; bh=lnj5rcek3XYlt8XQbMozjJgvMibJBtJ3s0FQbc/rosM=; b=sV64IfZsfg3KTqdZ7po73QERyBeWgqX9YPGGGnOahbPbtdG2n6AjPJIDEHaMjh22CD c2AgBSjC9VuG4GgQsQ0kQdCXztI8wfWgddAeyvXCwY0Vmrb3gyl65Y63JwNCqER6yilk mzBCuZxYWF35GoP1kNcgkK2On5TSUXPTWusMZkGdhvRw0qk/fzj1N0Te7OCfD4HNuMi0 aQ419whBt/FkBePWN2IRR0JzJyhei2QAlbagK2m7zlOEVqipciVDnjZF2GapaLlCGi0q 8bLIBkn/VWBbc6okEd5lIX1IeABenamtlu3DGt259hNtI8Z+kLYlGRYzccXVWCgiUHPm 9DOQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=gr3sL84N; 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 m2-v6si1439178plt.441.2018.04.03.14.14.41; Tue, 03 Apr 2018 14:14:58 -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; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=gr3sL84N; 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 S1753417AbeDCVM5 (ORCPT + 99 others); Tue, 3 Apr 2018 17:12:57 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:43898 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752639AbeDCVM4 (ORCPT ); Tue, 3 Apr 2018 17:12:56 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=In-Reply-To:Content-Transfer-Encoding :Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To:From:Date: Sender:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=lnj5rcek3XYlt8XQbMozjJgvMibJBtJ3s0FQbc/rosM=; b=gr3sL84Nf1u5GNf8AwC9fJxKts P/H7aOHV8IuQQI+oHPxAT8QCgpaPLwJLEwt+YCrRdUaZc5Zn7Sytfm66n52T+9yMOCZIsvuPSupze /3/tC2cmt/uRkz/aEe78xitDj1l25EFpCyJ3kBuAnPPqK/wrMy4GUUbruzTrIFT1POBQPkO45iu8m n21N+MGMPHPKrNO4/8BZ3E1wrqNkBTIXf+PrJ5WKIHuEzOkCbXlh1dHO9IgTg8uOVPe23ALnYbhm2 5fkkVExaepktcYlQNfgJKEm201lWCJYQqxCYWASWtXBPHc8dtG18zotYWEHLoOCxVdwlkGQ2Im6U2 W9Po6+qg==; Received: from willy by bombadil.infradead.org with local (Exim 4.90_1 #2 (Red Hat Linux)) id 1f3TEc-0005o0-2L; Tue, 03 Apr 2018 21:12:54 +0000 Date: Tue, 3 Apr 2018 14:12:53 -0700 From: Matthew Wilcox To: Buddy Lumpkin Cc: Michal Hocko , linux-mm@kvack.org, linux-kernel@vger.kernel.org, hannes@cmpxchg.org, riel@surriel.com, mgorman@suse.de, akpm@linux-foundation.org Subject: Re: [RFC PATCH 1/1] vmscan: Support multiple kswapd threads per node Message-ID: <20180403211253.GC30145@bombadil.infradead.org> 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> <20180403190759.GB6779@bombadil.infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.9.2 (2017-12-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Apr 03, 2018 at 01:49:25PM -0700, Buddy Lumpkin wrote: > > Yes, very much this. If you have a single-threaded workload which is > > using the entirety of memory and would like to use even more, then it > > makes sense to use as many CPUs as necessary getting memory out of its > > way. If you have N CPUs and N-1 threads happily occupying themselves in > > their own reasonably-sized working sets with one monster process trying > > to use as much RAM as possible, then I'd be pretty unimpressed to see > > the N-1 well-behaved threads preempted by kswapd. > > The default value provides one kswapd thread per NUMA node, the same > it was without the patch. Also, I would point out that just because you devote > more threads to kswapd, doesn’t mean they are busy. If multiple kswapd threads > are busy, they are almost certainly doing work that would have resulted in > direct reclaims, which are often substantially more expensive than a couple > extra context switches due to preemption. [...] > In my previous response to Michal Hocko, I described > how I think we could scale watermarks in response to direct reclaims, and > launch more kswapd threads when kswapd peaks at 100% CPU usage. I think you're missing my point about the workload ... kswapd isn't "nice", so it will compete with the N-1 threads which are chugging along at 100% CPU inside their working sets. In this scenario, we _don't_ want to kick off kswapd at all; we want the monster thread to clean up its own mess. If we have idle CPUs, then yes, absolutely, lets have them clean up for the monster, but otherwise, I want my N-1 threads doing their own thing. Maybe we should renice kswapd anyway ... thoughts? We don't seem to have had a nice'd kswapd since 2.6.12, but maybe we played with that earlier and discovered it was a bad idea?