linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dave Hansen <dave.hansen@intel.com>
To: lizhe.67@bytedance.com, dave.hansen@linux.intel.com,
	luto@kernel.org, peterz@infradead.org
Cc: linux-kernel@vger.kernel.org, lizefan.x@bytedance.com,
	yuanzhu@bytedance.com
Subject: Re: [RFC] x86/mm/dump_pagetables: Allow dumping pagetables by pid
Date: Sat, 10 Sep 2022 16:09:55 -0700	[thread overview]
Message-ID: <ca8d4f94-a106-dc56-893d-d32d43beed85@intel.com> (raw)
In-Reply-To: <20220804070401.86524-1-lizhe.67@bytedance.com>

On 8/4/22 00:04, lizhe.67@bytedance.com wrote:
> In current kernel we can only dump a user task's pagetable
> by task itself. Sometimes we need to inspect the page table
> attributes of different memory maps to user space to meet
> the relevant development and debugging requirements. This
> patch helps us to make our works easier. It add two file
> named 'pid' and 'pid_pgtable_show'. We can use 'pid' to
> input the task we want to inspect and get pagetable info
> from 'pid_pgtable_show'.
> 
> User space can use file 'pid' and 'pid_pgtable_show' as follows.
> ====
> $ echo $pid > /sys/kernel/debug/page_tables/pid
> $ cat /sys/kernel/debug/page_tables/pid_pgtable_show

This seems a wee bit silly considering that we have /proc.  It's also
impossible to have an ABI like this work if multiple processes are
trying to dump different pids.

Are there any other per-process things in debugfs where folks have done
something similar?

  reply	other threads:[~2022-09-10 23:10 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-04  7:04 [RFC] x86/mm/dump_pagetables: Allow dumping pagetables by pid lizhe.67
2022-09-10 23:09 ` Dave Hansen [this message]
2022-09-12  7:50   ` Peter Zijlstra

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ca8d4f94-a106-dc56-893d-d32d43beed85@intel.com \
    --to=dave.hansen@intel.com \
    --cc=dave.hansen@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lizefan.x@bytedance.com \
    --cc=lizhe.67@bytedance.com \
    --cc=luto@kernel.org \
    --cc=peterz@infradead.org \
    --cc=yuanzhu@bytedance.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).