Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp2445767pxb; Fri, 17 Sep 2021 09:54:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyh/osR9KHKKHru5Op1uCG2LdKI+1QwziYpEG+Xhs/sZXKbZpugv6uIEEgdORZK0nrMr1Op X-Received: by 2002:a5e:db49:: with SMTP id r9mr9582746iop.104.1631897675006; Fri, 17 Sep 2021 09:54:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631897674; cv=none; d=google.com; s=arc-20160816; b=YRU5/PsHzQBilPKyQlORMns01zvojeJJ4bXIyKRQ4I0gJEoENRXqg3Q7UrP8w7UTu0 zn4RNxjrc3RFzt+EZx7bpPUeayNvPOvxRiB10RmCnJDxYxzymkyV60GFRqf/WjzOc8Cb fb5C7JL4fbLt7W+JU2yKcE9/9bNpEaV3RXwVkBYZujeF7L1a9dfPzAHzQPkp8MrWNfbv yO1Zjdu8PZbonCOYJt3Cq9nJaxR1t07kKn6cNkibK2RDEd9W9P/6Xyz21iQiMdskgS9r TqsZvEp49UeAnTkeJf8oQKQd3l+CRVFrdt2KbEV/BkW/tWNz3r5FqWa/+gnzMygO9YTi RSpQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=Tu3a1Jctb+y1+7cxgmrLpvSnXHcTL/tz3Dc1kAZAv0Q=; b=hbbnBhzmWKvXfrNwpA+kHRpvBFKgPzp6dLoesORCqbjkjWpjWI0dAOhopyyWrVdCVL WP51bD0wSN2tXJ5sfWamDXIrp4GnaCBOU+5JG6GJVcacxmpJAHEwtMX4mdosNwrNpvLi QmdiNlSezcv2uep4UptaCzu3N11JNM2aPJLxjhNrFeJs2y0QUTxMcqiAzQQY1QGwVsFM 9IR23xGQVU4Sf/6mmSxmbRjVRuYtTtT6c4VPGljk3KO4slbrLrEwKWm2aZB53QEUxWd9 uGQN2WxTK++X2Uj7w/yRkkmVseSA9CGaFq5bI6acDH+sy/CpSz0gHa5M9k+gxe/v0aY+ k69A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=giZQkmV4; 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 g14si6752296jat.122.2021.09.17.09.54.23; Fri, 17 Sep 2021 09:54:34 -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=20210112 header.b=giZQkmV4; 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 S243979AbhIQD36 (ORCPT + 99 others); Thu, 16 Sep 2021 23:29:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55384 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230044AbhIQD3y (ORCPT ); Thu, 16 Sep 2021 23:29:54 -0400 Received: from mail-pj1-x1035.google.com (mail-pj1-x1035.google.com [IPv6:2607:f8b0:4864:20::1035]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3E160C061574 for ; Thu, 16 Sep 2021 20:28:33 -0700 (PDT) Received: by mail-pj1-x1035.google.com with SMTP id mv7-20020a17090b198700b0019c843e7233so2593195pjb.4 for ; Thu, 16 Sep 2021 20:28:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=Tu3a1Jctb+y1+7cxgmrLpvSnXHcTL/tz3Dc1kAZAv0Q=; b=giZQkmV4Kzeopwo0M5oTuJlcGAU7l4owc5drUG/GlrbB0pmiSt+SmyGfIhroFF6v7F cuQO36118jy4rxW3tjXuyx9Pkn8sjC5odSZVModBvy4CqK7JeKy39AbGkILrdLxQu4nX G28co+YDLcGWmyw8sAd/ZsBPDhyaaWkysrHGAy+Vw4LWQ9m39Aqebh6jsoNJt0wMvqgl YJumhGkX85KMPJawyznLHrDOMBRF9eomtTIBz7oEwcuNh5dUHbfm0QrGzvKOKhrWHu9X 9eTcbUCCVgwjbtA7B9ypJebQ9E4M5xf5WrP8oCTmIfjGxSU4jCqgMaaoFGDmT51KhT5A ozDw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=Tu3a1Jctb+y1+7cxgmrLpvSnXHcTL/tz3Dc1kAZAv0Q=; b=1GehWRPTQP0FRhpiwtppzzAh5REJxzCGOzXqvsqVCYyo1ayX0oUBCAeaJUEoMp59CW m5EzLPwefEUREPdMmVvzuz+m6WdFc8MsFBFf4HKfiC5/ll1Rov/j4yBoCafjcYBnNTVS pWi1Pktd7dLyg7XrnSHw0Wo8xW3vdoJ5gyiMgP+qrw4MZqE2tY1ewQevp7gCT6lVBDNy VXFgiAHPemV8Ur6MOUGbAi22EZ9jMzxGUhzr7xLd6cfFoaz3abD7D14jtUI3fkEPyDng SCvsJMwzQdIjBDkeKV/X281lby3BqCawRj9xHmDfSy8TRs5HUYi98Md0nX9gVhGKBDCt SvFg== X-Gm-Message-State: AOAM5321Hvqyeu4Wwt/EX75EJK827n+xMNTjotoiK2CBfvH96CoG2K8R zgDoWcodBGSG7VwcZf6QqpA= X-Received: by 2002:a17:90a:cc02:: with SMTP id b2mr9871214pju.160.1631849312742; Thu, 16 Sep 2021 20:28:32 -0700 (PDT) Received: from WRT-WX9.lan ([141.164.41.4]) by smtp.gmail.com with ESMTPSA id n19sm4288047pfa.60.2021.09.16.20.28.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 Sep 2021 20:28:32 -0700 (PDT) From: Changbin Du To: Andrew Morton Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, Changbin Du Subject: [PATCH] tools/vm/page-types: remove dependency on opt_file for idle page tracking Date: Fri, 17 Sep 2021 11:28:26 +0800 Message-Id: <20210917032826.10669-1-changbin.du@gmail.com> X-Mailer: git-send-email 2.32.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Idle page tracking can also be used for process address space, not only file mappings. Without this change, using with '-i' option for process address space encounters below errors reported. $ sudo ./page-types -p $(pidof bash) -i mark page idle: Bad file descriptor mark page idle: Bad file descriptor mark page idle: Bad file descriptor mark page idle: Bad file descriptor mark page idle: Bad file descriptor mark page idle: Bad file descriptor .... Signed-off-by: Changbin Du --- tools/vm/page-types.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/vm/page-types.c b/tools/vm/page-types.c index 0517c744b04e..f62f10c988db 100644 --- a/tools/vm/page-types.c +++ b/tools/vm/page-types.c @@ -1331,7 +1331,7 @@ int main(int argc, char *argv[]) if (opt_list && opt_list_mapcnt) kpagecount_fd = checked_open(PROC_KPAGECOUNT, O_RDONLY); - if (opt_mark_idle && opt_file) + if (opt_mark_idle) page_idle_fd = checked_open(SYS_KERNEL_MM_PAGE_IDLE, O_RDWR); if (opt_list && opt_pid) -- 2.32.0