Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp879494ybp; Fri, 4 Oct 2019 06:27:27 -0700 (PDT) X-Google-Smtp-Source: APXvYqzVfzg1qHPW5h7KGKl8GxBgZj279K/b1LPd8/oP3M2ARY+ZCSxfJV8wYpFGSCgaRL5MLt5a X-Received: by 2002:a50:f0db:: with SMTP id a27mr15140149edm.17.1570195647625; Fri, 04 Oct 2019 06:27:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570195647; cv=none; d=google.com; s=arc-20160816; b=e+5eNoGKqGzcCoV2scyFDAhBgZkpOvJxpE0xlFTLBZHevYfl8sbt21d4d7RFi7kHmn nzAxrQ7EwfV2os4D3TkanhgD4civLt0laqJZXSUiPn/PhpX3SD3xyOk6l120PSLGLLqw Lo60ssERvOnz24zAi3KgkNxzgietYKaOY3+t/cOEGR9PBXxXOcaHVCBWsYKG0ZUwY8WI e50d9m4ZyhvlEfg8qmXCrDLZj2EU3rfbIhEvZkddBKZqAZjoP8GR5mGXuQ5CeqQx/F/y S1w90pfSuB3RFtXa0HOIATOK8mdIFEhVav6BnhbIPILfDr5MU0N0zK1Mx2L+ePX0OGU4 wh/A== 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:dkim-signature; bh=iWYDUEgKuCJeyJ9I6tYYxrawWm8Ddb31rIaod5aHvEQ=; b=YlneWIlRm0RM/q0MYf5oj/tqk3bao9H5vfFSDa8gwtkOfUdWpC6hqInHnbc9iFtm/7 xAVT/1o1YNWZ8N+amaicifqGMhima9OS4ADFV9ZF+IVL/VFK8yY0KF3JguZwONeXQuZF vJLnheknbcxPQ/2Hb1Cg9hzBrNA5bPP/+10vM5rb9ntevqFwNfCXWQ1DwACBadKboaYZ pqI0EUGl18GPv/curPgQU+Ve449nrp+ZIDAJj72r6YUuiaks6b86vZwrTPIZyVC1w33/ SoXMURWHQ0S0T6WUoEirdxpaqn52mzLVWgUAyj3cdwPFgp7cYOYtHTRULhj16HLFQ11n 5fag== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@shutemov-name.20150623.gappssmtp.com header.s=20150623 header.b=UTqM58yf; 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 g22si3689245eda.27.2019.10.04.06.27.02; Fri, 04 Oct 2019 06:27:27 -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=pass header.i=@shutemov-name.20150623.gappssmtp.com header.s=20150623 header.b=UTqM58yf; 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 S2388313AbfJDN01 (ORCPT + 99 others); Fri, 4 Oct 2019 09:26:27 -0400 Received: from mail-ed1-f68.google.com ([209.85.208.68]:39776 "EHLO mail-ed1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388197AbfJDN01 (ORCPT ); Fri, 4 Oct 2019 09:26:27 -0400 Received: by mail-ed1-f68.google.com with SMTP id a15so5822297edt.6 for ; Fri, 04 Oct 2019 06:26:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=shutemov-name.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=iWYDUEgKuCJeyJ9I6tYYxrawWm8Ddb31rIaod5aHvEQ=; b=UTqM58yftpKounDpD+4rAyIh0EPTO6sSobQgHt7atHQjC6TplYZV1uL7Pd9pvU8Vfh ioTH7H78xYUGHRX8TkHQzF+eIr4+uEWYxFv5+Iu4QKtqrOB3GRdeiJY3i+i324HSf4X8 k/sfG6qYxEAtkXWP7ej6YifNl95NLmgBxBcAAJCEJ+qAhLYzXznt56UQWETMOn6CQZWe CbFd3OAWGcigI5gFmR0ModJdNdjm6ex5JHy1G80II/jop5Ark/Q+oOFkmNQIww2FFo1/ qV/ShDCfTk6ThII0/GlExArOauZsOlEZ+pMh0iuqQ5jvrFx/0diovtefYIjC14xpPR/u irFQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=iWYDUEgKuCJeyJ9I6tYYxrawWm8Ddb31rIaod5aHvEQ=; b=oyql88CEI87jwdGMoDWi05khPLG9RZ5LxUEkJkyFj8GtFcDob2USDT6UUj5BLG0rc8 WTONxtX0X8wDiGz7WR6W+O7rhDq9wu2R3dMTbbgL3glu+b8j1zb6m9r0QHL5xps3nMEw XcDwu+ubpMBEWpYHMmkSHoUDJfaUEZ8w62Z/ynMMMF/BBnCFjhu63kSt4Os0hzqrF0Bh qylHcqlWYw4Y3jQCKxWkGpKtEC25dXDgxI9dtgKMYVKS5NFEKh9JH/URd0oXjd/FTT13 R6AwCfPiIdNKpV4VGyZim7/FUZPN0hlOhves9juOkzVTtU9V/HhHZ24CTkfMZVfR9WQr yaZw== X-Gm-Message-State: APjAAAVbWy4LxbHMJZu0CUAQqakKNaDxhNT4kn10Tem8vTk346GH3IFs tJRzbqrPru51mVM3yQIfghVrWA== X-Received: by 2002:aa7:c4d0:: with SMTP id p16mr15268554edr.266.1570195585640; Fri, 04 Oct 2019 06:26:25 -0700 (PDT) Received: from box.localdomain ([86.57.175.117]) by smtp.gmail.com with ESMTPSA id z39sm1115252edd.46.2019.10.04.06.26.24 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 04 Oct 2019 06:26:25 -0700 (PDT) Received: by box.localdomain (Postfix, from userid 1000) id 1F27F102143; Fri, 4 Oct 2019 16:26:24 +0300 (+03) Date: Fri, 4 Oct 2019 16:26:24 +0300 From: "Kirill A. Shutemov" To: Michal Hocko Cc: Daniel Colascione , Qian Cai , Tim Murray , Suren Baghdasaryan , linux-mm@vger.kernel.org, linux-kernel , linux-mm Subject: Re: [PATCH] Make SPLIT_RSS_COUNTING configurable Message-ID: <20191004132624.ctaodxaxsd7wzwlh@box> References: <1C584B5C-E04E-4B04-A3B5-4DC8E5E67366@lca.pw> <20191004123349.GB10845@dhcp22.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191004123349.GB10845@dhcp22.suse.cz> User-Agent: NeoMutt/20180716 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Oct 04, 2019 at 02:33:49PM +0200, Michal Hocko wrote: > On Wed 02-10-19 19:08:16, Daniel Colascione wrote: > > On Wed, Oct 2, 2019 at 6:56 PM Qian Cai wrote: > > > > On Oct 2, 2019, at 4:29 PM, Daniel Colascione wrote: > > > > > > > > Adding the correct linux-mm address. > > > > > > > > > > > >> +config SPLIT_RSS_COUNTING > > > >> + bool "Per-thread mm counter caching" > > > >> + depends on MMU > > > >> + default y if NR_CPUS >= SPLIT_PTLOCK_CPUS > > > >> + help > > > >> + Cache mm counter updates in thread structures and > > > >> + flush them to visible per-process statistics in batches. > > > >> + Say Y here to slightly reduce cache contention in processes > > > >> + with many threads at the expense of decreasing the accuracy > > > >> + of memory statistics in /proc. > > > >> + > > > >> endmenu > > > > > > All those vague words are going to make developers almost impossible to decide the right selection here. It sounds like we should kill SPLIT_RSS_COUNTING at all to simplify the code as the benefit is so small vs the side-effect? > > > > Killing SPLIT_RSS_COUNTING would be my first choice; IME, on mobile > > and a basic desktop, it doesn't make a difference. I figured making it > > a knob would help allay concerns about the performance impact in more > > extreme configurations. > > I do agree with Qian. Either it is really helpful (is it? probably on > the number of cpus) and it should be auto-enabled or it should be > dropped altogether. You cannot really expect people know how to enable > this without a deep understanding of the MM internals. Not to mention > all those users using distro kernels/configs. > > A config option sounds like a bad way forward. And I don't see much point anyway. Reading RSS counters from proc is inherently racy. It can just either way after the read due to process behaviour. -- Kirill A. Shutemov