From: Randy Dunlap <rdunlap@infradead.org>
To: Xin Zhao <jackzxcui1989@163.com>,
david@kernel.org, brauner@kernel.org, ljs@kernel.org,
rppt@kernel.org, pfalcato@suse.de, viro@zeniv.linux.org.uk,
corbet@lwn.net, skhan@linuxfoundation.org,
akpm@linux-foundation.org, liam@infradead.org, vbabka@kernel.org,
surenb@google.com, mhocko@suse.com, mingo@redhat.com,
peterz@infradead.org, juri.lelli@redhat.com,
vincent.guittot@linaro.org, mjguzik@gmail.com,
ebiederm@xmission.com, jack@suse.cz, jlayton@kernel.org,
chuck.lever@oracle.com, alex.aring@gmail.com, arnd@arndb.de,
keescook@chromium.org, mcgrof@kernel.org, j.granados@samsung.com,
allen.lkml@gmail.com
Cc: kuba@kernel.org, linux-fsdevel@vger.kernel.org,
linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org,
linux-mm@kvack.org, linux-doc@vger.kernel.org
Subject: Re: [PATCH v8] coredump: Add bit 9 of coredump_filter for pre-exit files before dumping
Date: Fri, 7 Aug 2026 22:55:42 -0700 [thread overview]
Message-ID: <f3bcf9e5-89eb-4885-a671-910722782ca8@infradead.org> (raw)
In-Reply-To: <20260808052732.2589657-1-jackzxcui1989@163.com>
Hi,
On 8/7/26 10:27 PM, Xin Zhao wrote:
> diff --git a/Documentation/filesystems/proc.rst b/Documentation/filesystems/proc.rst
> index db6167bef..aee03858b 100644
> --- a/Documentation/filesystems/proc.rst
> +++ b/Documentation/filesystems/proc.rst
> @@ -1927,7 +1927,7 @@ will be dumped when the <pid> process is dumped. coredump_filter is a bitmask
> of memory types. If a bit of the bitmask is set, memory segments of the
> corresponding memory type are dumped, otherwise they are not dumped.
>
> -The following 9 memory types are supported:
> +The following 10 memory types are supported:
>
> - (bit 0) anonymous private memory
> - (bit 1) anonymous shared memory
> @@ -1939,6 +1939,7 @@ The following 9 memory types are supported:
> - (bit 6) hugetlb shared memory
> - (bit 7) DAX private memory
> - (bit 8) DAX shared memory
> + - (bit 9) fd list
>
> Note that MMIO pages such as frame buffer are never dumped and vDSO pages
> are always dumped regardless of the bitmask status.
> @@ -1946,13 +1947,19 @@ The following 9 memory types are supported:
> Note that bits 0-4 don't affect hugetlb or DAX memory. hugetlb memory is
> only affected by bit 5-6, and DAX is only affected by bits 7-8.
>
> -The default value of coredump_filter is 0x33; this means all anonymous memory
> -segments, ELF header pages and hugetlb private memory are dumped.
> + Note that bit 9 is set by default because tools like systemd-coredump go
> + through the fds. If you do not set bit 9, files that are not referenced by
> + any VMA are released before dumping core. Some file release logic, such as
> + exiting flock or releasing references to shared buffers is executed much
> + earlier.
> +
> +The default value of coredump_filter is 0x233; this means all anonymous memory
> +segments, ELF header pages, hugetlb private memory and fd list are dumped.
>
> If you don't want to dump all shared memory segments attached to pid 1234,
> -write 0x31 to the process's proc file::
> +write 0x231 to the process's proc file::
>
> - $ echo 0x31 > /proc/1234/coredump_filter
> + $ echo 0x231 > /proc/1234/coredump_filter
>
> When a new process is created, the process inherits the bitmask status from its
> parent. It is useful to set up coredump_filter before the program runs.
The proc.rst update LGTM. Thanks.
Acked-by: Randy Dunlap <rdunlap@infradead.org> # for proc.rst
--
~Randy
next prev parent reply other threads:[~2026-08-08 5:56 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-08 5:27 Xin Zhao
2026-08-08 5:55 ` Randy Dunlap [this message]
2026-08-11 9:09 ` Christian Brauner
2026-08-11 9:22 ` Xin Zhao
2026-08-11 16:22 ` Mateusz Guzik
2026-08-25 12:31 ` Christian Brauner
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=f3bcf9e5-89eb-4885-a671-910722782ca8@infradead.org \
--to=rdunlap@infradead.org \
--cc=akpm@linux-foundation.org \
--cc=alex.aring@gmail.com \
--cc=allen.lkml@gmail.com \
--cc=arnd@arndb.de \
--cc=brauner@kernel.org \
--cc=chuck.lever@oracle.com \
--cc=corbet@lwn.net \
--cc=david@kernel.org \
--cc=ebiederm@xmission.com \
--cc=j.granados@samsung.com \
--cc=jack@suse.cz \
--cc=jackzxcui1989@163.com \
--cc=jlayton@kernel.org \
--cc=juri.lelli@redhat.com \
--cc=keescook@chromium.org \
--cc=kuba@kernel.org \
--cc=liam@infradead.org \
--cc=linux-arch@vger.kernel.org \
--cc=linux-doc@vger.kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=ljs@kernel.org \
--cc=mcgrof@kernel.org \
--cc=mhocko@suse.com \
--cc=mingo@redhat.com \
--cc=mjguzik@gmail.com \
--cc=peterz@infradead.org \
--cc=pfalcato@suse.de \
--cc=rppt@kernel.org \
--cc=skhan@linuxfoundation.org \
--cc=surenb@google.com \
--cc=vbabka@kernel.org \
--cc=vincent.guittot@linaro.org \
--cc=viro@zeniv.linux.org.uk \
/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
all inboxes | Powered by JetHome®