[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAPNVh5fQXB7tLi=tKyabmScZge53PwzQ3kqP2ASE+3DD+eTdGg@mail.gmail.com>
Date: Mon, 13 Sep 2021 11:00:06 -0700
From: Peter Oskolkov <posk@...gle.com>
To: Prakash Sangappa <prakash.sangappa@...cle.com>
Cc: Jann Horn <jannh@...gle.com>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
linux-api <linux-api@...r.kernel.org>,
Ingo Molnar <mingo@...hat.com>, Paul Turner <pjt@...gle.com>,
Peter Oskolkov <posk@...k.io>,
Peter Zijlstra <peterz@...radead.org>
Subject: Re: [RESEND RFC PATCH 0/3] Provide fast access to thread specific data
On Mon, Sep 13, 2021 at 10:36 AM Prakash Sangappa
<prakash.sangappa@...cle.com> wrote:
[...]
> > This sounds, again, as if the kernel should be aware of the kind of
> > items being allocated; having a more generic mechanism of allocating
> > pinned memory for the userspace to use at its discretion would be more
> > generally useful, I think. But how then the kernel/system should be
> > protected from a buggy or malicious process trying to grab too much?
> >
> > One option would be to have a generic in-kernel mechanism for this,
> > but expose it to the userspace via domain-specific syscalls that do
> > the accounting you hint at. This sounds a bit like an over-engineered
> > solution, though…
>
>
> What will this pinned memory be used for in your use case,
> can you explain?
For userspace scheduling, to share thread/task state information
between the kernel and the userspace. This memory will be allocated
per task/thread; both the kernel and the userspace will write to the
shared memory, and these reads/writes will happen not only in the
memory regions belonging to the "current" task/thread, but also to
remote tasks/threads.
Somewhat detailed doc/rst is here:
https://lore.kernel.org/lkml/20210908184905.163787-5-posk@google.com/
Powered by blists - more mailing lists