Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp564937pxb; Fri, 29 Oct 2021 15:34:23 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxbBt2iRgpE0luwL9c8hgeiZf+TKcPFmEbjShR/7TDkL/e/kJmtLI+LZ/4gDhvmWcKlcDIn X-Received: by 2002:a92:cd84:: with SMTP id r4mr9627532ilb.310.1635546863457; Fri, 29 Oct 2021 15:34:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635546863; cv=none; d=google.com; s=arc-20160816; b=mZu9CG983yoaiWYGI11xaSkMEb2L3QwzKfsyE8JHScPss4nhyB3jnlqhk/I0QxGA/Z bCJ3KDeuNCVG4w9+YRDVd4EmUt1aiUFIIkZhjb8QPruocGrElsglMjq03XYAXzIVDCzE UUjBRIwn3zR3lurpM4ow9feQfuWaUCLJQ3tGZ+OvvDnOvUwufPczlmk1bPu5iHMm73oS eU2m1cFYK8eEn/1Cxx1tunOd+64yGg6yXTbWX6ujTvHAnYyh4nhx4zJ8rVSzaPUe2ZgL m4sBbnHThJ356NX10NfRUHB+mLVUkTQdXR5lapdcXPjE8i/zxNtmdZvJZpC5dGeibOiU AFUw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=Qp6+zjDSd4OOLDe8/BIO29FCy7h5ITgGaqmhvNYsKr8=; b=xYN+WYc0SMHsZRrp9rMaV2LZNnYHMqs4J6P/NKVuTB/BNNyCRkgbjp+OrYo2mgdoWu bAzUZcn3aJy0rMzlVDFAyAxYCK65v3daGBWUJf8kabjYcC0+ZFhl5JA+DGF6EFJU73S9 NBh9vA1cY9sAzthd2NVrBPkmOu0mlYgznloSurQoKOXrLhMlLLKNXpDM2MwwLEFwD/Jf DjDiBMjYyAKQm9hUx03gcS21yDBZN5QNOggwPneLTfpk0cQliIdtruES5QTGMofIiZP2 kjYAyEoDN93J/16TO+B1KZB9LUnS79maGkmRuogBfOe6X3I4JqrZgpFKhdgUZ+QmJywc W22w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=Mv2KXcJN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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. [23.128.96.18]) by mx.google.com with ESMTP id s19si9451215jat.11.2021.10.29.15.34.11; Fri, 29 Oct 2021 15:34:23 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=Mv2KXcJN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S229441AbhJ2WeW (ORCPT + 99 others); Fri, 29 Oct 2021 18:34:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42406 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230504AbhJ2WeV (ORCPT ); Fri, 29 Oct 2021 18:34:21 -0400 Received: from mail-pf1-x42c.google.com (mail-pf1-x42c.google.com [IPv6:2607:f8b0:4864:20::42c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 56EACC061714 for ; Fri, 29 Oct 2021 15:31:52 -0700 (PDT) Received: by mail-pf1-x42c.google.com with SMTP id l1so4034210pfu.5 for ; Fri, 29 Oct 2021 15:31:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=Qp6+zjDSd4OOLDe8/BIO29FCy7h5ITgGaqmhvNYsKr8=; b=Mv2KXcJNajDF1a5vJiq3Uxo93jSk5UbONlTJlUsFvFkeV3GHwlpi6nzXdgiw8k1L7Q Zu+iQ27x4FVnK6Fv5/UuCT7td78f5pK1rdcxZvrMWM1Ft4YQprljfaCJxnyARaijLNry ZHH/IOhPaZLk/FAGM8bpNyTZC77eObvLOmHW3QgMJe4OzWEdcefxVaRLckV6qI/jg6mk mQLpuor4gB8wvoKBenRn46kuhRE2RC0sLvJND3p41Qoihcp/MVwBfUly64thvbr83lZR /nHORyWnTMwMbMNXUUomU26GJyneswDebjRc8nJwtU64yvDvhb0a9KdtwfFSkVltLfSU E1yQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=Qp6+zjDSd4OOLDe8/BIO29FCy7h5ITgGaqmhvNYsKr8=; b=VaM3rimDf1XR49lFnUSAWc8vUg3dMYOidbVuZpvAiSkOh2rv6fCZXFf6Eew3wtIq1t qvBC4Uel7uTwtzMPYLji2UyRlAygbjN6RYYREuAHIP9XUFb/4RH5uuLcxZDzZJMQ63+r ANlFdDy+sUFgy48b4GwjCYNmZcowiCmrt7gDsbEdoeVo47eN/Qd/hnLWHGh0QHYjJjMc dsTiDeSXu8FFR4naKUW3APZ6NnTmr/zZQVonjG9RZTQi0KBOgI5EH+u9Ei9z2F1fYBWf qnjb4ZY8LUPc8SieD69S+HykOwU4b1QtMYX0ceFMNAu0R1OPdxXf3RzGj/Zeh1HCl7m8 bP9w== X-Gm-Message-State: AOAM530gaVC4Ui9xVAjHtVlkH52kumCZenCPSVI9WOnazNYZxiJnyGcL DL/mWo40ehO+gsCYu7LT1Gsw/gOIIPLHmZVwLy4KoQ== X-Received: by 2002:a62:7858:0:b0:47c:1cf3:d95 with SMTP id t85-20020a627858000000b0047c1cf30d95mr13882255pfc.60.1635546711320; Fri, 29 Oct 2021 15:31:51 -0700 (PDT) MIME-Version: 1.0 References: <20211029183339.3216491-1-kaleshsingh@google.com> <20211029183339.3216491-2-kaleshsingh@google.com> <20211029144524.367d6789@gandalf.local.home> <20211029162549.2c22f2dd@gandalf.local.home> In-Reply-To: <20211029162549.2c22f2dd@gandalf.local.home> From: Kalesh Singh Date: Fri, 29 Oct 2021 15:31:40 -0700 Message-ID: Subject: Re: [PATCH v2 1/4] tracing/histogram: Optimize division by constants To: Steven Rostedt Cc: surenb@google.com, hridya@google.com, namhyung@kernel.org, kernel-team@android.com, mhiramat@kernel.org, Jonathan Corbet , Ingo Molnar , Shuah Khan , Tom Zanussi , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Oct 29, 2021 at 1:25 PM Steven Rostedt wrote: > > On Fri, 29 Oct 2021 11:53:16 -0700 > Kalesh Singh wrote: > > > > If these functions are only called when val2 is constant, can't we make it > > > such that we get val2 from the hist_field directly? That is: > > > > > > u64 val2 = operand2->constant; > > > > operand2 might be a var ref to a constant, so we would need to resolve > > that with hist_field_var_ref(). > > So can a var_ref change? If not, then we should convert that to a constant > for this operation. A var ref to a constant won't change. I think we can just copy the constant value to the var ref's hist field and then we'll be able to get it from there instead of calling the fn() function. I'll post another version with this. Thanks, Kalesh > > -- Steve