From: Uladzislau Rezki <urezki@gmail.com>
To: Michal Hocko <mhocko@kernel.org>
Cc: Uladzislau Rezki <urezki@gmail.com>,
Joel Fernandes <joel@joelfernandes.org>,
Shuah Khan <shuah@kernel.org>,
Matthew Wilcox <willy@infradead.org>,
Kees Cook <keescook@chromium.org>,
Andrew Morton <akpm@linux-foundation.org>,
linux-mm@kvack.org, LKML <linux-kernel@vger.kernel.org>,
Thomas Garnier <thgarnie@google.com>,
Oleksiy Avramchenko <oleksiy.avramchenko@sonymobile.com>,
Steven Rostedt <rostedt@goodmis.org>,
Joel Fernandes <joelaf@google.com>,
Thomas Gleixner <tglx@linutronix.de>, Ingo Molnar <mingo@elte.hu>,
Tejun Heo <tj@kernel.org>,
maco@android.com
Subject: Re: [RFC PATCH 0/2] improve vmalloc allocation
Date: Thu, 25 Oct 2018 12:42:57 +0200 [thread overview]
Message-ID: <20181025104257.adtktxmggxewspvy@pc636> (raw)
In-Reply-To: <20181025084327.GN18839@dhcp22.suse.cz>
On Thu, Oct 25, 2018 at 10:43:27AM +0200, Michal Hocko wrote:
> On Wed 24-10-18 19:34:18, Uladzislau Rezki wrote:
> > Hi.
> >
> > On Wed, Oct 24, 2018 at 08:22:52AM +0200, Michal Hocko wrote:
> > > On Tue 23-10-18 12:30:44, Joel Fernandes wrote:
> > > > On Tue, Oct 23, 2018 at 11:13:36AM -0600, Shuah Khan wrote:
> > > > > On 10/23/2018 11:05 AM, Michal Hocko wrote:
> > > > > > On Tue 23-10-18 08:26:40, Matthew Wilcox wrote:
> > > > > >> On Tue, Oct 23, 2018 at 09:02:56AM -0600, Shuah Khan wrote:
> > > > > > [...]
> > > > > >>> The way it can be handled is by adding a test module under lib. test_kmod,
> > > > > >>> test_sysctl, test_user_copy etc.
> > > > > >>
> > > > > >> The problem is that said module can only invoke functions which are
> > > > > >> exported using EXPORT_SYMBOL. And there's a cost to exporting them,
> > > > > >> which I don't think we're willing to pay, purely to get test coverage.
> > > > > >
> > > > > > Yes, I think we do not want to export internal functionality which might
> > > > > > be still interesting for the testing coverage. Maybe we want something
> > > > > > like EXPORT_SYMBOL_KSELFTEST which would allow to link within the
> > > > > > kselftest machinery but it wouldn't allow the same for general modules
> > > > > > and will not give any API promisses.
> > > > > >
> > > > >
> > > > > I like this proposal. I think we will open up lot of test opportunities with
> > > > > this approach.
> > > > >
> > > > > Maybe we can use this stress test as a pilot and see where it takes us.
> > > >
> > > > I am a bit worried that such an EXPORT_SYMBOL_KSELFTEST mechanism can be abused by
> > > > out-of-tree module writers to call internal functionality.
> > > >
> > > > How would you prevent that?
> > >
> > > There is no way to prevent non-exported symbols abuse by 3rd party
> > > AFAIK. EXPORT_SYMBOL_* is not there to prohibid abuse. It is a mere
> > > signal of what is, well, an exported API.
> >
> > Can we just use kallsyms_lookup_name()?
>
> Heh, this is the abuse I've had in mind ;)
> > <snip>
> > static void *((*__my_vmalloc_node_range)(unsigned long size,
> > unsigned long align,unsigned long start, unsigned long end,
> > gfp_t gfp_mask,pgprot_t prot, unsigned long vm_flags,
> > int node, const void *caller));
> >
> > __my_vmalloc_node_range = (void *) kallsyms_lookup_name("__vmalloc_node_range");
> > <snip>
>
> This is just too ugly to live. So I would go with it only if there is no
> reasonable way to export what tests need with a sane interface.
Agree, that is a bit ugly and not generic even though it is easy :)
--
Vlad Rezki
next prev parent reply other threads:[~2018-10-25 10:45 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-10-19 17:35 [RFC PATCH 0/2] improve vmalloc allocation Uladzislau Rezki (Sony)
2018-10-19 17:35 ` [RFC PATCH 1/2] mm/vmalloc: keep track of free blocks for allocation Uladzislau Rezki (Sony)
2018-10-29 13:39 ` [LKP] [mm/vmalloc] 8dab1f5c1e: BUG:soft_lockup-CPU##stuck_for#s kernel test robot
2018-10-19 17:35 ` [RFC PATCH 2/2] mm: add priority threshold to __purge_vmap_area_lazy() Uladzislau Rezki (Sony)
2018-10-19 22:44 ` [RFC PATCH 0/2] improve vmalloc allocation Roman Gushchin
2018-10-22 14:01 ` Uladzislau Rezki
2018-10-20 0:11 ` Joel Fernandes
2018-10-22 14:50 ` Uladzislau Rezki
2018-10-23 6:36 ` Joel Fernandes
2018-10-22 12:51 ` Michal Hocko
2018-10-22 16:52 ` Uladzislau Rezki
2018-10-23 7:23 ` Michal Hocko
2018-10-23 15:02 ` Shuah Khan
2018-10-23 15:26 ` Matthew Wilcox
2018-10-23 17:05 ` Michal Hocko
2018-10-23 17:13 ` Shuah Khan
2018-10-23 19:30 ` Joel Fernandes
2018-10-23 19:48 ` Shuah Khan
2018-10-23 20:09 ` Matthew Wilcox
2018-10-23 20:50 ` Shuah Khan
2018-10-23 21:01 ` Joel Fernandes
2018-10-24 6:22 ` Michal Hocko
2018-10-24 17:34 ` Uladzislau Rezki
2018-10-25 8:43 ` Michal Hocko
2018-10-25 10:42 ` Uladzislau Rezki [this message]
2018-10-24 16:36 ` Uladzislau Rezki
2018-10-24 23:01 ` Andrew Morton
2018-10-25 10:33 ` Uladzislau Rezki
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=20181025104257.adtktxmggxewspvy@pc636 \
--to=urezki@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=joel@joelfernandes.org \
--cc=joelaf@google.com \
--cc=keescook@chromium.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=maco@android.com \
--cc=mhocko@kernel.org \
--cc=mingo@elte.hu \
--cc=oleksiy.avramchenko@sonymobile.com \
--cc=rostedt@goodmis.org \
--cc=shuah@kernel.org \
--cc=tglx@linutronix.de \
--cc=thgarnie@google.com \
--cc=tj@kernel.org \
--cc=willy@infradead.org \
/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).