Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp1390194ybe; Thu, 5 Sep 2019 15:00:01 -0700 (PDT) X-Google-Smtp-Source: APXvYqypXMjFanQv44XTXpbswsS406Tye18g9edIovcIhv9M6ZWScb/beDOYNVn968ybkLDKZRkn X-Received: by 2002:a63:7b4d:: with SMTP id k13mr5079730pgn.182.1567720801434; Thu, 05 Sep 2019 15:00:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567720801; cv=none; d=google.com; s=arc-20160816; b=xoFWm3jfp/LJTR+Vi7U6DCNCDHa8im44O5ZmC2w6NwLyRGcgoSfZ5UmRYZi77dY+oa PoXbbSDE57QnTrnypMUpxCGPz8y+V4To6Alxl6x2rk5J6Lcz6D387yCyYDDuX63s/BLW HS48iiw/jeYSJCEQ1Lr/DNchkRw403735MxXHlib6p0qlGhZvTa8yWBYSNqGCO629UPC PgJNJJa8ysuB9dYuczmgu1hA++hsLzi6rHGUHzizF54DUKtkVEiytAC5K6lJHVHinScX X6WylKMGiykaRtGkYYrceAtyPod4xr12A0BU9CcBeas8dE3oulCyP20Aq/mR97wZTMjL fGCg== 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=s9Pb/MqseZ7RlVVs3CNYNbMIo2YR/MhIel99V5tLuCc=; b=aflp0ojwx8LY0ek6uFf/CAKsvl6MShmf/j3S075m8BAfetChIQ+YXxIm3GL1KlOJKn qoQGNC7cE4kguDbeM4RC7TLK4qZ7/46cpDMbieT9QMmtAkDd8qRY4Xbk9XCWYNzhuenB zNbwUlB1pckPu95thLaNPz0Y9M+bvim6qdi/txyu2bM9/bUcgEqKZJrkkIYHzEE4euwI syzTGpjiAV8isKr6evBpBhFtkO08NhBPnPYFtbhFdqosqav9hMCfPSjObYjVrMXC0YmB LdXAWDCSEFYgL7lqiyqfhPP3UJcvlt/pYldlQsR6tNMGT/s2ZlxGwyxE/SPrszH0n5Nm dVRw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b="WHn/mLxT"; 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 j6si3403611pfh.289.2019.09.05.14.59.43; Thu, 05 Sep 2019 15:00: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="WHn/mLxT"; 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 S2391177AbfIERvF (ORCPT + 99 others); Thu, 5 Sep 2019 13:51:05 -0400 Received: from mail-ot1-f66.google.com ([209.85.210.66]:37214 "EHLO mail-ot1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2391170AbfIERvF (ORCPT ); Thu, 5 Sep 2019 13:51:05 -0400 Received: by mail-ot1-f66.google.com with SMTP id s28so3069814otd.4 for ; Thu, 05 Sep 2019 10:51:04 -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=s9Pb/MqseZ7RlVVs3CNYNbMIo2YR/MhIel99V5tLuCc=; b=WHn/mLxT0ucnyH4gwmp/qpzJbEfaFthNeKdoZwnD/B6/MVQRQqb4wZywL53jq1qIaV gb+TdKsinHPlj+LQlhJoWRU/D7IK2UvLu1uZIbpc98h3j/SLg1FkucCLBSn6QE6a4xv4 8A5stXVWsUc3IDcyzSxMHbj/jVhShunx3l22pRcWTxEOi/t6ar1ofl0voxcoIdRfl5r0 JMwCWrcjsdNR+EnBKm+WG+n9gRil9h1uAYDHR5V3SPQZC5up027FI9BVXsnmIJn/wGLH a5ELOGPKH2gOOayWt8fPr7sEKLjPvuIF8jdNUuBz8MhE7vzVl2frNjh13WOdqLyRGTLI PW/A== 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=s9Pb/MqseZ7RlVVs3CNYNbMIo2YR/MhIel99V5tLuCc=; b=WsjnBBCyCXoVmDMSwAt1m8J8Uw1qmHt6VuistghjhwdXrSlfjJoYNk2hkWNDOht5Oi aGKFPkgxmD9MJ41WbOKs6iNUj1Zx+Jbv8xZ9vCBiwivvZRTalIljwyBLnabqhQbkv5im NJQgQ8qADE6ebkj3eMVHOn1AFBHpT+3uRNDw5qIgzMm0Ws/3ob9CkuCH04WBmxyjLESb cHMVtujgDP3zIeuAH9yrBS/jGS9zsT2WXIHhdj4m2smXFyW/LnVDZxV8MymIs10/BboF EM1y43gp+nlFWkydtWFxkf2er+gIFxbqsL1wvRr8t9eE+0bZWjnyuVWNsZoSFQfdaC+7 lEAw== X-Gm-Message-State: APjAAAXW9zdY2r2oEWp0sSovD+DSEzQFEH8zcPiWqZNDVQewYIPE+DMG M56zGtA1q3rrnfLtpNRMt59zCMbgbEnM1IT3QpVYyQ== X-Received: by 2002:a9d:6189:: with SMTP id g9mr3419331otk.348.1567705863632; Thu, 05 Sep 2019 10:51:03 -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: Daniel Colascione Date: Thu, 5 Sep 2019 10:50:27 -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 , Tim Murray , Carmen Jackson , Mayank Gupta , 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 10:35 AM Steven Rostedt wrote: > On Thu, 5 Sep 2019 09:03:01 -0700 > Suren Baghdasaryan wrote: > > > On Thu, Sep 5, 2019 at 7:43 AM Michal Hocko wrote: > > > > > > [Add Steven] > > > > > > On Wed 04-09-19 12:28:08, Joel Fernandes wrote: > > > > On Wed, Sep 4, 2019 at 11:38 AM Michal Hocko wrote: > > > > > > > > > > On Wed 04-09-19 11:32:58, Joel Fernandes wrote: > > > [...] > > > > > > but also for reducing > > > > > > tracing noise. Flooding the traces makes it less useful for long traces and > > > > > > post-processing of traces. IOW, the overhead reduction is a bonus. > > > > > > > > > > This is not really anything special for this tracepoint though. > > > > > Basically any tracepoint in a hot path is in the same situation and I do > > > > > not see a point why each of them should really invent its own way to > > > > > throttle. Maybe there is some way to do that in the tracing subsystem > > > > > directly. > > > > > > > > I am not sure if there is a way to do this easily. Add to that, the fact that > > > > you still have to call into trace events. Why call into it at all, if you can > > > > filter in advance and have a sane filtering default? > > > > > > > > The bigger improvement with the threshold is the number of trace records are > > > > almost halved by using a threshold. The number of records went from 4.6K to > > > > 2.6K. > > > > > > Steven, would it be feasible to add a generic tracepoint throttling? > > > > 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 mean like add a trigger (or filter) that only traces if a field has > changed since the last time the trace was hit? Hmm, I think we could > possibly do that. Perhaps even now with histogram triggers? I was thinking along the same lines. The histogram subsystem seems like a very good fit here. Histogram triggers already let users talk about specific fields of trace events, aggregate them in configurable ways, and (importantly, IMHO) create synthetic new trace events that the kernel emits under configurable conditions.