From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.2 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C45AAC4CED1 for ; Fri, 4 Oct 2019 13:26:28 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 7FB30222C0 for ; Fri, 4 Oct 2019 13:26:28 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=shutemov-name.20150623.gappssmtp.com header.i=@shutemov-name.20150623.gappssmtp.com header.b="UTqM58yf" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7FB30222C0 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=shutemov.name Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 31D1F8E0006; Fri, 4 Oct 2019 09:26:28 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 2CBE48E0005; Fri, 4 Oct 2019 09:26:28 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 1E39C8E0006; Fri, 4 Oct 2019 09:26:28 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id F08308E0005 for ; Fri, 4 Oct 2019 09:26:27 -0400 (EDT) Received: from smtpin19.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with SMTP id 86A5E8243768 for ; Fri, 4 Oct 2019 13:26:27 +0000 (UTC) X-FDA: 76006176414.19.woman33_5564c79d76143 X-HE-Tag: woman33_5564c79d76143 X-Filterd-Recvd-Size: 5428 Received: from mail-ed1-f65.google.com (mail-ed1-f65.google.com [209.85.208.65]) by imf12.hostedemail.com (Postfix) with ESMTP for ; Fri, 4 Oct 2019 13:26:26 +0000 (UTC) Received: by mail-ed1-f65.google.com with SMTP id f20so5811488edv.8 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=nxFkgAdIKdAuB24YgriZDqD0kPVz5d9afIviCRPxKs8G6qmQx4J9/LYugG0R7pXZ6h paOKqFBnyC6RVVD8YIQXImBuh4uHat1MsEG0R9fWFAI/mCFuJxRB2uXCEiSQkoEs/TUd tAZ+FTXrMqEDH27dHru/yJ9FtbDcb6BFXu7SfBCLAuGJpDQdbQ3QVAWjwlQLHdshsz34 9xcLWfjH2jtHXfQ9/hgsmjxUSo3te7/36YuGSQTI61YBZjBoOsOvbP5LFGLdlUeSd0Fi KHfdHBvonXQbEu//TfQy59xZ3uxNd8J4hi06vV84jcv3Zclfjl6nOkmlCzwvVKiZNh4s BJ9Q== X-Gm-Message-State: APjAAAWVgzG/Td6wcqAdfMlvMb0R4IkGeHWo7NifONtumPQyNF33m13/ Yu6F7uuphB7G1Ipl+6c3AGtzkA== X-Google-Smtp-Source: APXvYqy3lg5fGs39WgPY20gmrfOzi6+KMhhev0MZZy1hZjCN0h3YpvVCFSn45T6y83HlbvFzqQTbcw== 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 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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