[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200803201221.GA6463@osiris>
Date: Mon, 3 Aug 2020 22:12:21 +0200
From: Heiko Carstens <hca@...ux.ibm.com>
To: Thomas Gleixner <tglx@...utronix.de>
Cc: Sven Schnelle <svens@...ux.ibm.com>,
Vincenzo Frascino <vincenzo.frascino@....com>,
linux-kernel@...r.kernel.org,
Peter Zijlstra <peterz@...radead.org>,
linux-s390@...r.kernel.org
Subject: Re: [PATCH 2/2] s390: convert to GENERIC_VDSO
On Mon, Aug 03, 2020 at 09:27:36PM +0200, Thomas Gleixner wrote:
> Heiko Carstens <hca@...ux.ibm.com> writes:
>
> > On Mon, Aug 03, 2020 at 06:05:24PM +0200, Thomas Gleixner wrote:
> >> +/**
> >> + * vdso_update_begin - Start of a VDSO update section
> >> + *
> >> + * Allows architecture code to safely update the architecture specific VDSO
> >> + * data.
> >> + */
> >> +void vdso_update_begin(void)
> >> +{
> >> + struct vdso_data *vdata = __arch_get_k_vdso_data();
> >> +
> >> + raw_spin_lock(&timekeeper_lock);
> >> + vdso_write_begin(vdata);
> >> +}
> >
> > I would assume that this only works if vdso_update_begin() is called
> > with irqs disabled, otherwise it could deadlock, no?
>
> Yes.
>
> > Maybe something like:
> >
> > void vdso_update_begin(unsigned long *flags)
> > {
> > struct vdso_data *vdata = __arch_get_k_vdso_data();
> >
> > raw_spin_lock_irqsave(&timekeeper_lock, *flags);
> > vdso_write_begin(vdata);
>
> Shudder. Why not returning flags?
That was what I had initially but then looked at lock_timer_base(),
and tried to be consistent. Ok, bad example, since lock_timer_base()
cannot return flags.
> Thought about that briefly, but then hated the flags thing and delegated
> it to the caller. Lockdep will yell if that lock is taken with
> interrupts enabled :)
>
> But aside of the pointer vs. value thing, I'm fine with doing it in the
> functions.
FWIW, my preference would also to use values instead of pointers.
Powered by blists - more mailing lists