Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp278864ybe; Tue, 3 Sep 2019 22:44:35 -0700 (PDT) X-Google-Smtp-Source: APXvYqxQ7qFYvuT0T3gSLUpJcN2diROsyagMMI/iMhMSLojfHnHrFhIP0xJixwrVMb8HikOH6Hwu X-Received: by 2002:a17:902:b70f:: with SMTP id d15mr17752660pls.285.1567575875260; Tue, 03 Sep 2019 22:44:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567575875; cv=none; d=google.com; s=arc-20160816; b=RpbHGBG5nsYsfyycWgNpNQj1GI6jCFc7dXjRznbLe/iauvYPGITpjHSnf+Dglfp3jx feYSODYO6gXhfdEpL6axDlI/GssCwW9iu/pG8lvSEdLoVO44P0aPU7f/F+nPCnNbihpw vFQ43hKWg3SpRen2H0s4V0XQu2plzG6JW4d1bnruqwUc+Mxae1qG1fRwvgmISXgbsx6D 0Oix95PtWEHbR0mpp99OY8eVFFZSqAoecljy/aYzuA6sq4z8/9G9ow9cxeGMhZo85s66 TGJt7vDSHaJ5yamPi4QU8DFytaWW6Wp+sSuGNz9E82HHFybGrJdXKTEhAoFBjMqBQZjI oKgQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=JnRNNgV0YhAL6zDufOYnxx16nsh9d1vYCiomDUcaQzQ=; b=tbfBzY0uU8bR4forHk1/f/obXFf/hDsjUiznHeR1TUpsqwiRG8aJ+9Tp/YBncQ+6s2 bilaLDT+l6tlv7oWT8j5lvTa8MFtb7G5TOx/3STKk8ZarOqDigi1F9d/nQugubhbfztg tvqOUhzHUVKQqs75o4Gt65tPIMUPzTejNOiOnkLz8uWuSewzv3B9Q+4Q+rFnyTs4Y6ex D19m1UhieHfBqHasu9ddbaJhoggFK6w15PtRo3TF8aNNkNJB4rpsaS7VFw/trh78+GCm XUbmqq3MWOP0+4vlP1IYfoqVVJBd2xzd0wfQcVO4QzFJnrcK+XLn6JQQwakWcKov2PcP QxJg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=RqFGqfbZ; 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=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a2si1559362pjk.63.2019.09.03.22.44.19; Tue, 03 Sep 2019 22:44:35 -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=@google.com header.s=20161025 header.b=RqFGqfbZ; 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=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727787AbfIDFnc (ORCPT + 99 others); Wed, 4 Sep 2019 01:43:32 -0400 Received: from mail-vs1-f67.google.com ([209.85.217.67]:45538 "EHLO mail-vs1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725877AbfIDFnb (ORCPT ); Wed, 4 Sep 2019 01:43:31 -0400 Received: by mail-vs1-f67.google.com with SMTP id j25so12920303vsq.12 for ; Tue, 03 Sep 2019 22:43:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=JnRNNgV0YhAL6zDufOYnxx16nsh9d1vYCiomDUcaQzQ=; b=RqFGqfbZDZiAsCUpWiNxYO5pmn2x9w0/Zvk8sQAl2V9qUSyuDZlgKa6QeoZU+D2pNv bs3KZ1L49lefsiL2PWQHlG/LpXLNTQQ+pmDWVRTsWxS8zrQLdZlGW0paddD74QYIKRJN aURn8PGPDYOMHm3g31y+5fkF3Uj6ZXYd8v4IHMXpfh2kjCm+dMX5XaKvVryFFOBsSyWl Qt7DNTBYRDB1beJ4wYqZIIYEL44JTc2fuja8HsD/z6eEBnX3CtkHd058k0AyPf8AgyOi YCLaXcWiDZ3psUkjYa3D5Nm+krvlWmvf1O1f0YEda0pyMgxZOPKkhwLc+5lKomde3HFS 08YA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=JnRNNgV0YhAL6zDufOYnxx16nsh9d1vYCiomDUcaQzQ=; b=AfpqDy7pnYCHueqJel4QQAbVjdjeMwHQP3xjlPc9+KTVefC6m57v/IncVqCbrFIJUy aS2yaaFPw/hyrVuUfj9HUMPlblpNAS25q8URpb6eR6RwsQQ6F1qOERqTw45fA8qM/H1S 1jV4M+Df5D6/S2rDKUQGHJsQab9LlZGzeztAA9sjA8ufNBPlXCO+3FRaOVSeRG1fawAX wBxNI+p3VPvNFKyb2cCDxoc/N8XL/bvSdYs5Ct5eJllYM26d1l418WqOngnES6KqIgJ3 N2S7b+jr+hInykqFWO/aF9ZO4nHV5TBOnmjZLij/YK1rieJm6MYJZ+wpmoKgPLIgeLdE inbg== X-Gm-Message-State: APjAAAXLInHykTlVdppYMKr96C6OkgguZTctgl4GzO2FWtziBlyE/xer +rtKFAnTNqa8kJGtOZkImMgmjOWToz3n776VERqIUw== X-Received: by 2002:a67:f606:: with SMTP id k6mr21358828vso.114.1567575810342; Tue, 03 Sep 2019 22:43:30 -0700 (PDT) MIME-Version: 1.0 References: <20190903200905.198642-1-joel@joelfernandes.org> <20190904051549.GB256568@google.com> In-Reply-To: <20190904051549.GB256568@google.com> From: Daniel Colascione Date: Tue, 3 Sep 2019 22:42:53 -0700 Message-ID: Subject: Re: [PATCH v2] mm: emit tracepoint when RSS changes by threshold To: Joel Fernandes Cc: Suren Baghdasaryan , LKML , Tim Murray , Carmen Jackson , Mayank Gupta , Steven Rostedt , Minchan Kim , Andrew Morton , kernel-team , "Aneesh Kumar K.V" , Dan Williams , Jerome Glisse , linux-mm , Matthew Wilcox , Michal Hocko , Ralph Campbell , Vlastimil Babka Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Sep 3, 2019 at 10:15 PM Joel Fernandes wrote: > > On Tue, Sep 03, 2019 at 09:51:20PM -0700, Daniel Colascione wrote: > > On Tue, Sep 3, 2019 at 9:45 PM Suren Baghdasaryan wrote: > > > > > > On Tue, Sep 3, 2019 at 1:09 PM Joel Fernandes (Google) > > > wrote: > > > > > > > > Useful to track how RSS is changing per TGID to detect spikes in RSS and > > > > memory hogs. Several Android teams have been using this patch in various > > > > kernel trees for half a year now. Many reported to me it is really > > > > useful so I'm posting it upstream. > > > > It's also worth being able to turn off the per-task memory counter > > caching, otherwise you'll have two levels of batching before the > > counter gets updated, IIUC. > > I prefer to keep split RSS accounting turned on if it is available. Why? AFAIK, nobody's produced numbers showing that split accounting has a real benefit. > I think > discussing split RSS accounting is a bit out of scope of this patch as well. It's in-scope, because with split RSS accounting, allocated memory can stay accumulated in task structs for an indefinite time without being flushed to the mm. As a result, if you take the stream of virtual memory management system calls that program makes on one hand, and VM counter values on the other, the two don't add up. For various kinds of robustness (trace self-checking, say) it's important that various sources of data add up. If we're adding a configuration knob that controls how often VM counters get reflected in system trace points, we should also have a knob to control delayed VM counter operations. The whole point is for users to be able to specify how precisely they want VM counter changes reported to analysis tools. > Any improvements on that front can be a follow-up. > > Curious, has split RSS accounting shown you any issue with this patch? Split accounting has been a source of confusion for a while now: it causes that numbers-don't-add-up problem even when sampling from procfs instead of reading memory tracepoint data.