From: Joel Fernandes <joel@joelfernandes.org>
To: Greg KH <gregkh@linuxfoundation.org>
Cc: linux-kernel@vger.kernel.org,
Masahiro Yamada <yamada.masahiro@socionext.com>,
Andrew Morton <akpm@linux-foundation.org>,
ast@kernel.org, atishp04@gmail.com, dancol@google.com,
Dan Williams <dan.j.williams@intel.com>,
dietmar.eggemann@arm.com, Guenter Roeck <groeck@chromium.org>,
Jonathan Corbet <corbet@lwn.net>,
karim.yaghmour@opersys.com, Kees Cook <keescook@chromium.org>,
kernel-team@android.com, linux-doc@vger.kernel.org,
linux-kselftest@vger.kernel.org,
linux-trace-devel@vger.kernel.org,
Manoj Rao <linux@manojrajarao.com>,
mhiramat@kernel.org, qais.yousef@arm.com, rdunlap@infradead.org,
rostedt@goodmis.org, Shuah Khan <shuah@kernel.org>,
yhs@fb.com, Olof Johansson <olof@lixom.net>
Subject: Re: [PATCH v7 resend 1/2] Provide in-kernel headers to make extending kernel easier
Date: Mon, 29 Apr 2019 09:26:02 -0400 [thread overview]
Message-ID: <20190429132602.GA165075@google.com> (raw)
In-Reply-To: <20190427133844.GA29366@kroah.com>
On Sat, Apr 27, 2019 at 03:38:44PM +0200, Greg KH wrote:
> On Fri, Apr 26, 2019 at 03:04:29PM -0400, Joel Fernandes (Google) wrote:
> > Introduce in-kernel headers which are made available as an archive
> > through proc (/proc/kheaders.tar.xz file). This archive makes it
> > possible to run eBPF and other tracing programs that need to extend the
> > kernel for tracing purposes without any dependency on the file system
> > having headers.
> >
> > A github PR is sent for the corresponding BCC patch at:
> > https://github.com/iovisor/bcc/pull/2312
> >
> > On Android and embedded systems, it is common to switch kernels but not
> > have kernel headers available on the file system. Further once a
> > different kernel is booted, any headers stored on the file system will
> > no longer be useful. This is an issue even well known to distros.
> > By storing the headers as a compressed archive within the kernel, we can
> > avoid these issues that have been a hindrance for a long time.
> >
> > The best way to use this feature is by building it in. Several users
> > have a need for this, when they switch debug kernels, they do not want to
> > update the filesystem or worry about it where to store the headers on
> > it. However, the feature is also buildable as a module in case the user
> > desires it not being part of the kernel image. This makes it possible to
> > load and unload the headers from memory on demand. A tracing program can
> > load the module, do its operations, and then unload the module to save
> > kernel memory. The total memory needed is 3.3MB.
> >
> > By having the archive available at a fixed location independent of
> > filesystem dependencies and conventions, all debugging tools can
> > directly refer to the fixed location for the archive, without concerning
> > with where the headers on a typical filesystem which significantly
> > simplifies tooling that needs kernel headers.
> >
> > The code to read the headers is based on /proc/config.gz code and uses
> > the same technique to embed the headers.
> >
> > Other approaches were discussed such as having an in-memory mountable
> > filesystem, but that has drawbacks such as requiring an in-kernel xz
> > decompressor which we don't have today, and requiring usage of 42 MB of
> > kernel memory to host the decompressed headers at anytime. Also this
> > approach is simpler than such approaches.
> >
> > Reviewed-by: Masahiro Yamada <yamada.masahiro@socionext.com>
> > Signed-off-by: Joel Fernandes (Google) <joel@joelfernandes.org>
>
> Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Thanks for the Reviewed-by tag. I believe there are still 2 logistical things
to merge this.
1. Location of the header archive:
Olof and Steve did not like it to be in /proc and instead /sys seemed a better
choice they are Ok with. Me and Greg were Ok with it being in /sys/kernel/.
Alexei, Greg and me are Ok with either proc or Sys.
2. Who is going to pull this patch: This seems a matter of where the header
archive resides. If it is in /sys/kernel/ then I am assuming Greg will pull
it. Masahiro has given his Reviewed-by tag, is he the one to pull it?
Let us agree on these open questions so I can respin the patch to be based on
that and move this forward.
thanks!
- Joel
next prev parent reply other threads:[~2019-04-29 13:26 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-04-26 19:04 [PATCH v7 resend 1/2] Provide in-kernel headers to make extending kernel easier Joel Fernandes (Google)
2019-04-26 19:04 ` [PATCH v7 resend 2/2] init/config: Do not select BUILD_BIN2C for IKCONFIG Joel Fernandes (Google)
2019-04-27 13:38 ` [PATCH v7 resend 1/2] Provide in-kernel headers to make extending kernel easier Greg KH
2019-04-29 13:26 ` Joel Fernandes [this message]
2019-04-29 13:54 ` Greg KH
2019-04-29 14:14 ` Masahiro Yamada
2019-04-29 14:24 ` Greg KH
2019-04-29 14:29 ` Joel Fernandes
2019-05-03 7:30 ` Pavel Machek
2019-05-03 7:49 ` Greg KH
2019-05-03 14:33 ` Steven Rostedt
2019-05-03 15:08 ` Joel Fernandes
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=20190429132602.GA165075@google.com \
--to=joel@joelfernandes.org \
--cc=akpm@linux-foundation.org \
--cc=ast@kernel.org \
--cc=atishp04@gmail.com \
--cc=corbet@lwn.net \
--cc=dan.j.williams@intel.com \
--cc=dancol@google.com \
--cc=dietmar.eggemann@arm.com \
--cc=gregkh@linuxfoundation.org \
--cc=groeck@chromium.org \
--cc=karim.yaghmour@opersys.com \
--cc=keescook@chromium.org \
--cc=kernel-team@android.com \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=linux-trace-devel@vger.kernel.org \
--cc=linux@manojrajarao.com \
--cc=mhiramat@kernel.org \
--cc=olof@lixom.net \
--cc=qais.yousef@arm.com \
--cc=rdunlap@infradead.org \
--cc=rostedt@goodmis.org \
--cc=shuah@kernel.org \
--cc=yamada.masahiro@socionext.com \
--cc=yhs@fb.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).