Received: by 2002:a05:6a10:c604:0:0:0:0 with SMTP id y4csp588752pxt; Fri, 6 Aug 2021 08:59:03 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz43UK8hYXQPxVrzJxZBKpkvxjREeEfeEP2SWhDJkMQKWXPGenAgfclNiummuTYKc5Dg2aL X-Received: by 2002:a5d:9f18:: with SMTP id q24mr58130iot.27.1628265543462; Fri, 06 Aug 2021 08:59:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628265543; cv=none; d=google.com; s=arc-20160816; b=jlDtgNRgYswvo0isTakr/SOiHjpCg7TdJsfH6i2vVUArP6/SHv15kFzRtH4BnST9Tf UU/iUwCHrs3n/POG9WT3nza41PhVHehgYKWZDK0zKst1//wzYC17y5Pl8LWx19+EmPud xLLsl3MEdSbALfoKBrcgZ/c7dqrWBoy3JJC32SrP1fD9hcS3zCyJIOklW753Qm0WU4u2 rv9RmASPA32ehU00KKwGsW6NyaFfQfAENQRwGI+KLjgLLQdZIxQkmtGJ9WzGMcjYs4Bg S4IERG8aOgNMmAwr77vQdu2agqNz4+Pj3AbDIL10tUrjvjS4GFNqgvFq9LVKwEmU5yJ5 YoRA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=BBUaoNE0IbHV53qO+WAxQddu4xQPBbh8BMh0jZwcruA=; b=qMDdCMtQTBZJJTHKJzTEDu4leUdsyLm6RdbqjvJgK+EL22R3Om/1zk2xb8vu64cYeZ T1vVoSpxMLqvvh9zjWf7N9R4fj2uW4DD0FHPm0JvCQhYIsvTTSLz3nsbSQqFdOhAK3D0 5Ro/dtX3tjU3Y7cVHRXbdOxYZjOG+EfJgZftnbFCVHHZO45Po4BnkvaeVgpRh9F4Igl7 TJjuRMyQzkUN+5aSSxQ7HQcVvravCMnkMzTT+KiXk4koPWICWPErEcd4zkBHYcd8jE4S nXaVvkpNFpkH0LlNv7QXO0PUhpPmsa5I9QSnsgwHqdCtKu6o0cKHs9QR4iUdf1ovdj9h ZqeA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=UGYO8Xfl; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w3si9311887ilg.140.2021.08.06.08.58.51; Fri, 06 Aug 2021 08:59:03 -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=@gmail.com header.s=20161025 header.b=UGYO8Xfl; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243239AbhHFLrl (ORCPT + 99 others); Fri, 6 Aug 2021 07:47:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49666 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229819AbhHFLri (ORCPT ); Fri, 6 Aug 2021 07:47:38 -0400 Received: from mail-qk1-x72c.google.com (mail-qk1-x72c.google.com [IPv6:2607:f8b0:4864:20::72c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 29B53C061798; Fri, 6 Aug 2021 04:47:21 -0700 (PDT) Received: by mail-qk1-x72c.google.com with SMTP id f12so8370429qkh.10; Fri, 06 Aug 2021 04:47:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to; bh=BBUaoNE0IbHV53qO+WAxQddu4xQPBbh8BMh0jZwcruA=; b=UGYO8XflIKFBzKPQvL5rqM7+axUVT0po1AxTt2C4qGE+KPSHPthDNX6hu8Ywj2b1Fc 2mTnzrrTVl3qTIWjHz1ICttPxpVRWwuizsKCcH7qmjZokEjezNVgRh7m1SAx2ojSSHDY bUNyBMNKY01vnHeWM4jooGkcngDeZMfNRaXYfYgXH08b3NQsSCsguvGuq/vGccKK48z6 31QO3ZtnS7Jpk8p+xvg6xLbPH1eaHYno2RL5iJPKNZ2RhWsJpPyJIcoH3uzLor6i0C5C Riq40Oljh1sn81k4efcTLcXasGU0BAKyADiEq65HiA7oKJVb9ByKDZZIP8eYx0j24Apg /iFw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to; bh=BBUaoNE0IbHV53qO+WAxQddu4xQPBbh8BMh0jZwcruA=; b=oHEidDrIslUkefgAsuyqLR//rgnBxYkB19zGTgL/0AZmyreM8x0R73r7FcnZ0jC6ar uDNaLuc2d4toYntyZNRieh5rFX7LOj+y+ESKBAGfE5bVYxfcSaaheaAy7FOYnuXujozR pOBvkqoP8J533Mv+/Oq2KyBmsR0reeZ6Ulu49eQPje42a9Hyku/PFKbso680dLRgNDgP O/hsxxgxrd5w+a9qdixGRgXCGWb8Fg3mfmyVk2jtwoh2OOgpICsScX+SIvZ42l3Xd8Ws 5su/vdf6TvWbQ4/6IXXo2Oa7bg0k6WlXTA3ObV+49xZ7iR3YEj0i/e9ROGtB/US25x74 jMqw== X-Gm-Message-State: AOAM531eqU8lNOYpYR9qvc4Pdo0TFFa+Sn3/T6RCPjGWEJ1gw4ckAQ2c nG5fbF6vhHPyGZlRVITz6mQ= X-Received: by 2002:a05:620a:1022:: with SMTP id a2mr9988723qkk.136.1628250440395; Fri, 06 Aug 2021 04:47:20 -0700 (PDT) Received: from localhost.localdomain (ec2-35-169-212-159.compute-1.amazonaws.com. [35.169.212.159]) by smtp.gmail.com with ESMTPSA id n190sm2340521qke.134.2021.08.06.04.47.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 Aug 2021 04:47:20 -0700 (PDT) From: SeongJae Park X-Google-Original-From: SeongJae Park To: Andrew Morton Cc: SeongJae Park , SeongJae Park , Jonathan.Cameron@Huawei.com, acme@kernel.org, alexander.shishkin@linux.intel.com, amit@kernel.org, benh@kernel.crashing.org, brendanhiggins@google.com, corbet@lwn.net, david@redhat.com, dwmw@amazon.com, elver@google.com, fan.du@intel.com, foersleo@amazon.de, greg@kroah.com, gthelen@google.com, guoju.fgj@alibaba-inc.com, jgowans@amazon.com, joe@perches.com, mgorman@suse.de, mheyne@amazon.de, minchan@kernel.org, mingo@redhat.com, namhyung@kernel.org, peterz@infradead.org, riel@surriel.com, rientjes@google.com, rostedt@goodmis.org, rppt@kernel.org, shakeelb@google.com, shuah@kernel.org, sieberf@amazon.com, snu@zelle79.org, vbabka@suse.cz, vdavydov.dev@gmail.com, zgf574564920@gmail.com, linux-damon@amazon.com, linux-mm@kvack.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v34 07/13] mm/damon: Implement a debugfs-based user space interface Date: Fri, 6 Aug 2021 11:47:11 +0000 Message-Id: <20210806114711.6900-1-sjpark@amazon.de> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210805174316.ff4b6eee629f9f05259058d9@linux-foundation.org> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: SeongJae Park On Thu, 5 Aug 2021 17:43:16 -0700 Andrew Morton wrote: > On Fri, 16 Jul 2021 08:14:43 +0000 SeongJae Park wrote: > > > +#define targetid_is_pid(ctx) \ > > + (ctx->primitive.target_valid == damon_va_target_valid) > > + > > I think this can be implemented as a static inline C function? > > --- a/mm/damon/dbgfs.c~mm-damon-implement-a-debugfs-based-user-space-interface-fix-fix > +++ a/mm/damon/dbgfs.c > @@ -97,8 +97,10 @@ out: > return ret; > } > > -#define targetid_is_pid(ctx) \ > - (ctx->primitive.target_valid == damon_va_target_valid) > +static inline bool targetid_is_pid(const struct damon_ctx *ctx) > +{ > + return ctx->primitive.target_valid == damon_va_target_valid; > +} > > static ssize_t sprint_target_ids(struct damon_ctx *ctx, char *buf, ssize_t len) > { > > We prefer this because it looks better, provides typechecking and can > in some situations suppress unused variable warnings. Agreed, I will keep that preference in my mind. I also found that you already nicely made the change in the the -mm tree[1], appreciate! [1] https://www.ozlabs.org/~akpm/mmotm/broken-out/mm-damon-implement-a-debugfs-based-user-space-interface-fix-fix.patch Thanks, SeongJae Park