Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp133312ybe; Thu, 5 Sep 2019 18:59:01 -0700 (PDT) X-Google-Smtp-Source: APXvYqzfp81j+QWW/8nFmJLKxNRNkcWDh1Z+yPbrbfKtqCI9WiOQ69orpx3lwFrSYleAwF9aAV3a X-Received: by 2002:a63:4562:: with SMTP id u34mr5805014pgk.288.1567735141270; Thu, 05 Sep 2019 18:59:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567735141; cv=none; d=google.com; s=arc-20160816; b=Ii1MYgVQPe/9sUR1NBUVWD/phDzyyTC1X68j82u5s1yE1k/EIx50u94l64e0pJYc2o OFXXWtMvhwxsDlY85ZeASN+TtSo9smlLsiSiMAfPmDsbU8eHxfXD2jqftTGWvni0FItM C6Iw3X7DwaEbBsjDHzfmk2OfVq/fArGsicpr8dcEWWfM0CbpGsOOShxBTU21C1zvHnwX 6RWNK5gQ5JxCV4+Vm6Z5KJQsGDABXIqq3TvcYwdeQ8o2hsE0yGg1xONVE3YrvglOpDWU MyJgKY9pnBhxIwQk33qTnqIrPqtBDAatsxuu6/4oxSpa/jetCmq4xCmpVkQkOfmNccFu uqxA== 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=rc/+YGfLUH9jkcuM4RyWN0/LC7MBLhEbb07n7jnHO2w=; b=fpSwyoZz5JaQKmu0cbnHjiKO4l31V+ZiJpSYMvKc5SIR8F8rjgKrYXuaBUJqK06xaN Vv3zaRjvJB6jdpOmoLN47Gj/Pcf1cwCmKDqWdGJnHrVPbSRqsKPtXheZ+UMEnr7MQYyd HoiOUZPmLk4YU9JA84L7ciIOxrj+ETP+ajvxnJNmwS4Ug5OFl+wdV/V3i6Xz1LY7OQpm QPk4x9v5k6jjNE259ikim8fZQal4VuTWOUWqlFjs0BVY7drZWE/L5IAQhYZ86/SYUqVN litSm0/hSNfTMDe24l0yDHLZCZhgvPSsedP19xvAo5Iy1JD6hySyLQXdHPiJeZWhWy6R ngCA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=tm3lWKag; 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 a12si4021023pfo.84.2019.09.05.18.58.46; Thu, 05 Sep 2019 18:59:01 -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=tm3lWKag; 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 S1729626AbfIERnm (ORCPT + 99 others); Thu, 5 Sep 2019 13:43:42 -0400 Received: from mail-io1-f65.google.com ([209.85.166.65]:45238 "EHLO mail-io1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726829AbfIERnl (ORCPT ); Thu, 5 Sep 2019 13:43:41 -0400 Received: by mail-io1-f65.google.com with SMTP id f12so6603099iog.12 for ; Thu, 05 Sep 2019 10:43:41 -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=rc/+YGfLUH9jkcuM4RyWN0/LC7MBLhEbb07n7jnHO2w=; b=tm3lWKagI89vD+eLi7AXE8oD+HI62AAnfaWnXsUq9NyLp5VlO2gP+7z0HI8FIMTtI6 sKzk+mOcSfwqJbuyTG1BKDzHx4w5qzzjmNvzjjGGht2pEOPADoMAOobLKh+2Fso4bGF6 LToEQee7VsrLi2YWLJ5FlwEzxZRSSkXwDJMuWf51o++bndrEm0NoZbMFkljKB5o+yYMe NPyWpU0Zn1CGHTGXE3PFhBlso3mA9QmaAiVF4zoiIGTaD4dHWxtX1T68njZ+N+HEPnM5 MFIBf55iiiyOoB4fdquLw+XijgdWREOtGC1GD97Nt8kItvLcexGylq5cB+/8uvKqaPKx tKYg== 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=rc/+YGfLUH9jkcuM4RyWN0/LC7MBLhEbb07n7jnHO2w=; b=dMHJbHqGYg8VlN8J9IA+WOJvk76rRNHd3Uos7q5m7N6XPDPYDLldS7FcERtDFRVLzX ORPLd67zGqBH87l7pJygvvk8YhVUIFduRUvJkG41adruIxDw6U5iSQa7blWgZg/PoZda 4XQHuns6NTzfCxDTI0tCA8RmWlASSrS7R0cMS/ICZudt7XzpETwPh++qJiGpZIPqbp8Q NTRXPqcKWK1EtGT7evK92wfKHcAplUzbs2WX15rCMVLAEy5oMptM2AZxcOfGxim7p4A5 3BYBOu8U+74nHP8eQw/1ia1EMs0M5Gijd8SbW1l2yOgkf2Wkq0F8N73ArDaIFssxqvWW kAHQ== X-Gm-Message-State: APjAAAUAsReDXgWZ3pNia3Eo1k86+nMusLsmFAiWV/TxJ+f8MJY+Y5TT sfLBYSlRzxFZhq9jrf25vl58IzHQI0jGaG4/CiOemhQDXhE= X-Received: by 2002:a6b:bc47:: with SMTP id m68mr5651748iof.70.1567705420697; Thu, 05 Sep 2019 10:43:40 -0700 (PDT) MIME-Version: 1.0 References: <20190903200905.198642-1-joel@joelfernandes.org> <20190904084508.GL3838@dhcp22.suse.cz> <20190904153258.GH240514@google.com> <20190904153759.GC3838@dhcp22.suse.cz> <20190904162808.GO240514@google.com> <20190905144310.GA14491@dhcp22.suse.cz> <20190905133507.783c6c61@oasis.local.home> In-Reply-To: <20190905133507.783c6c61@oasis.local.home> From: Tim Murray Date: Thu, 5 Sep 2019 10:43:28 -0700 Message-ID: Subject: Re: [PATCH v2] mm: emit tracepoint when RSS changes by threshold To: Steven Rostedt Cc: Suren Baghdasaryan , Michal Hocko , Joel Fernandes , LKML , Carmen Jackson , Mayank Gupta , Daniel Colascione , Minchan Kim , Andrew Morton , kernel-team , "Aneesh Kumar K.V" , Dan Williams , Jerome Glisse , linux-mm , Matthew Wilcox , Ralph Campbell , Vlastimil Babka , Tom Zanussi 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 Thu, Sep 5, 2019 at 9:03 AM Suren Baghdasaryan wrote: > I might misunderstand this but is the issue here actually throttling > of the sheer number of trace records or tracing large enough changes > to RSS that user might care about? Small changes happen all the time > but we are likely not interested in those. Surely we could postprocess > the traces to extract changes large enough to be interesting but why > capture uninteresting information in the first place? IOW the > throttling here should be based not on the time between traces but on > the amount of change of the traced signal. Maybe a generic facility > like that would be a good idea? You want two properties from the tracepoint: - Small fluctuations in the value don't flood the trace buffer. If you get a new trace event from a process every time kswapd reclaims a single page from that process, you're going to need an enormous trace buffer that will have significant side effects on overall system performance. - Any spike in memory consumption gets a trace event, regardless of the duration of that spike. This tracepoint has been incredibly useful in both understanding the causes of kswapd wakeups and lowmemorykiller/lmkd kills and evaluating the impact of memory management changes because it guarantees that any spike appears in the trace output. As a result, the RSS tracepoint in particular needs to be throttled based on the delta of the value, not time. The very first prototype of the patch emitted a trace event per RSS counter change, and IIRC the RSS trace events consumed significantly more room in the buffer than sched_switch (and Android has a lot of sched_switch events). It's not practical to trace changes in RSS without throttling. If there's a generic throttling approach that would work here, I'm all for it; like Dan mentioned, there are many more counters that we would like to trace in a similar way.