From: Catalin Marinas <catalin.marinas@arm.com>
To: Andrei Vagin <avagin@gmail.com>
Cc: Mark Rutland <mark.rutland@arm.com>,
Dmitry Safonov <dima@arista.com>,
linux-kernel@vger.kernel.org,
Thomas Gleixner <tglx@linutronix.de>,
Vincenzo Frascino <vincenzo.frascino@arm.com>,
Will Deacon <will@kernel.org>,
Christian Brauner <christian.brauner@ubuntu.com>,
linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH v5 0/6] arm64: add the time namespace support
Date: Wed, 22 Jul 2020 19:15:06 +0100 [thread overview]
Message-ID: <20200722181506.GA4517@gaia> (raw)
In-Reply-To: <20200714015743.GA843937@gmail.com>
On Mon, Jul 13, 2020 at 06:57:43PM -0700, Andrei Vagin wrote:
> On Sat, Jul 04, 2020 at 11:40:55PM -0700, Andrei Vagin wrote:
> > On Wed, Jun 24, 2020 at 01:33:15AM -0700, Andrei Vagin wrote:
> > > Allocate the time namespace page among VVAR pages and add the logic
> > > to handle faults on VVAR properly.
> > >
> > > If a task belongs to a time namespace then the VVAR page which contains
> > > the system wide VDSO data is replaced with a namespace specific page
> > > which has the same layout as the VVAR page. That page has vdso_data->seq
> > > set to 1 to enforce the slow path and vdso_data->clock_mode set to
> > > VCLOCK_TIMENS to enforce the time namespace handling path.
> > >
> > > The extra check in the case that vdso_data->seq is odd, e.g. a concurrent
> > > update of the VDSO data is in progress, is not really affecting regular
> > > tasks which are not part of a time namespace as the task is spin waiting
> > > for the update to finish and vdso_data->seq to become even again.
> > >
> > > If a time namespace task hits that code path, it invokes the corresponding
> > > time getter function which retrieves the real VVAR page, reads host time
> > > and then adds the offset for the requested clock which is stored in the
> > > special VVAR page.
> > >
> >
> > > v2: Code cleanups suggested by Vincenzo.
> > > v3: add a comment in __arch_get_timens_vdso_data.
> > > v4: - fix an issue reported by the lkp robot.
> > > - vvar has the same size with/without CONFIG_TIME_NAMESPACE, but the
> > > timens page isn't allocated on !CONFIG_TIME_NAMESPACE. This
> > > simplifies criu/vdso migration between different kernel configs.
> > > v5: - Code cleanups suggested by Mark Rutland.
> > > - In vdso_join_timens, mmap_write_lock is downgraded to
> > > mmap_read_lock. The VMA list isn't changed there, zap_page_range
> > > doesn't require mmap_write_lock.
> > >
> > > Reviewed-by: Vincenzo Frascino <vincenzo.frascino@arm.com>
> > > Reviewed-by: Dmitry Safonov <dima@arista.com>
> >
> > Hello Will and Catalin,
> >
> > Have you had a chance to look at this patch set? I think it is ready to be
> > merged. Let me know if you have any questions.
>
> *friendly ping*
>
> If I am doing something wrong, let me know.
Not really, just haven't got around to looking into it. Mark Rutland
raised a concern (in private) about the safety of multithreaded apps
but I think you already replied that timens_install() checks for this
already [1].
Maybe a similar atomicity issue to the one raised by Mark but for
single-threaded processes: the thread is executing vdso code, gets
interrupted and a signal handler invokes setns(). Would resuming the
execution in the vdso code on sigreturn cause any issues?
[1] https://lore.kernel.org/linux-arm-kernel/d16b5cd1-bdb1-5667-fbda-c622cc795389@arista.com/
--
Catalin
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2020-07-22 18:16 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-06-24 8:33 [PATCH v5 0/6] arm64: add the time namespace support Andrei Vagin
2020-06-24 8:33 ` [PATCH 1/6] arm64/vdso: use the fault callback to map vvar pages Andrei Vagin
[not found] ` <159561069973.19270.10637845392621633755.b4-ty@arm.com>
2020-07-27 6:45 ` Andrei Vagin
2020-06-24 8:33 ` [PATCH 2/6] arm64/vdso: Zap vvar pages when switching to a time namespace Andrei Vagin
2020-06-24 15:18 ` Christian Brauner
2020-06-25 8:25 ` Andrei Vagin
2020-06-24 8:33 ` [PATCH 3/6] arm64/vdso: Add time namespace page Andrei Vagin
2020-06-24 8:33 ` [PATCH 4/6] arm64/vdso: Handle faults on timens page Andrei Vagin
2020-06-24 8:33 ` [PATCH 5/6] arm64/vdso: Restrict splitting VVAR VMA Andrei Vagin
2020-06-24 8:33 ` [PATCH 6/6] arm64: enable time namespace support Andrei Vagin
2020-07-05 6:40 ` [PATCH v5 0/6] arm64: add the " Andrei Vagin
2020-07-14 1:57 ` Andrei Vagin
2020-07-22 18:15 ` Catalin Marinas [this message]
2020-07-23 17:41 ` Andrei Vagin
2020-07-23 20:25 ` Thomas Gleixner
2020-07-24 11:01 ` Catalin Marinas
2020-07-24 13:22 ` Thomas Gleixner
2020-07-24 13:30 ` Christian Brauner
2020-07-24 14:40 ` Catalin Marinas
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=20200722181506.GA4517@gaia \
--to=catalin.marinas@arm.com \
--cc=avagin@gmail.com \
--cc=christian.brauner@ubuntu.com \
--cc=dima@arista.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=tglx@linutronix.de \
--cc=vincenzo.frascino@arm.com \
--cc=will@kernel.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).