Re: [patch 00/11] x86/vdso: Cleanups, simmplifications and CLOCK_TAI support

2018-09-14 Thread Peter Zijlstra
On Fri, Sep 14, 2018 at 02:56:46PM +0200, Florian Weimer wrote: > On 09/14/2018 02:50 PM, Thomas Gleixner wrote: > > Matt attempted to add CLOCK_TAI support to the VDSO clock_gettime() > > implementation, which extended the clockid switch case and added yet > > another slightly different copy of th

Re: [patch 09/11] x86/vdso: Simplify the invalid vclock case

2018-09-18 Thread Peter Zijlstra
On Tue, Sep 18, 2018 at 09:52:26AM +0200, Thomas Gleixner wrote: > On Mon, 17 Sep 2018, John Stultz wrote: > > On Mon, Sep 17, 2018 at 12:25 PM, Andy Lutomirski wrote: > > > Also, I'm not entirely convinced that this "last" thing is needed at > > > all. John, what's the scenario under which we ne

Re: [patch 09/11] x86/vdso: Simplify the invalid vclock case

2018-09-18 Thread Peter Zijlstra
On Tue, Sep 18, 2018 at 12:41:57PM +0200, Thomas Gleixner wrote: > On Tue, 18 Sep 2018, Thomas Gleixner wrote: > > On Tue, 18 Sep 2018, Thomas Gleixner wrote: > > > On Tue, 18 Sep 2018, Peter Zijlstra wrote: > > > > > Your memory serves you right. That&

Re: [patch 09/11] x86/vdso: Simplify the invalid vclock case

2018-09-18 Thread Peter Zijlstra
On Tue, Sep 18, 2018 at 03:23:08PM +0200, Thomas Gleixner wrote: > On Tue, 18 Sep 2018, Peter Zijlstra wrote: > > On Tue, Sep 18, 2018 at 12:41:57PM +0200, Thomas Gleixner wrote: > > > I still have one of the machines which is affected by this. > > > > Are we s

Re: [patch 00/11] x86/vdso: Cleanups, simmplifications and CLOCK_TAI support

2018-10-04 Thread Peter Zijlstra
On Thu, Oct 04, 2018 at 09:54:45AM +0200, Vitaly Kuznetsov wrote: > I was hoping to hear this from you :-) If I am to suggest how we can > move forward I'd propose: > - Check if pure TSC can be used on SkyLake+ systems (where TSC scaling > is supported). > - Check if non-masterclock mode is still n

Re: [patch 00/11] x86/vdso: Cleanups, simmplifications and CLOCK_TAI support

2018-10-04 Thread Peter Zijlstra
On Thu, Oct 04, 2018 at 07:00:45AM -0700, Andy Lutomirski wrote: > > On Oct 4, 2018, at 1:11 AM, Peter Zijlstra wrote: > > > >> On Thu, Oct 04, 2018 at 09:54:45AM +0200, Vitaly Kuznetsov wrote: > >> I was hoping to hear this from you :-) If I am to suggest ho

Re: [PATCH v3 1/7] seqnum_ops: Introduce Sequence Number Ops

2021-02-04 Thread Peter Zijlstra
On Wed, Feb 03, 2021 at 11:11:57AM -0700, Shuah Khan wrote: > +static inline u32 seqnum32_inc(struct seqnum32 *seq) > +{ > + atomic_t val = ATOMIC_INIT(seq->seqnum); > + > + seq->seqnum = (u32) atomic_inc_return(&val); > + if (seq->seqnum >= UINT_MAX) > + pr_info("Sequence N

Re: [PATCH v3 00/11] Introduce Simple atomic counters

2020-10-09 Thread Peter Zijlstra
On Fri, Oct 09, 2020 at 09:55:55AM -0600, Shuah Khan wrote: > This patch series is a result of discussion at the refcount_t BOF > the Linux Plumbers Conference. In this discussion, we identified > a need for looking closely and investigating atomic_t usages in > the kernel when it is used strictly

Re: [PATCH v3 00/11] Introduce Simple atomic counters

2020-10-10 Thread Peter Zijlstra
On Fri, Oct 09, 2020 at 01:45:43PM -0700, Kees Cook wrote: > On Fri, Oct 09, 2020 at 09:37:46PM +0200, Peter Zijlstra wrote: > > On Fri, Oct 09, 2020 at 09:55:55AM -0600, Shuah Khan wrote: > > > Simple atomic counters api provides interfaces for simple atomic counters > >

Re: [PATCH v3 00/11] Introduce Simple atomic counters

2020-10-14 Thread Peter Zijlstra
On Tue, Oct 13, 2020 at 08:12:20PM -0600, Shuah Khan wrote: > They don't add any new behavior, As Kees mentioned they do give us a > way to clearly differentiate atomic usages that can wrap. No it doesn't! atomic_t can wrap, this thing can wrap, no distinction. All it does is fragment the API an

Re: [PATCH v3 00/11] Introduce Simple atomic counters

2020-10-16 Thread Peter Zijlstra
On Wed, Oct 14, 2020 at 04:31:42PM -0700, Kees Cook wrote: > On Wed, Oct 14, 2020 at 11:17:20AM +0200, Peter Zijlstra wrote: > > On Tue, Oct 13, 2020 at 08:12:20PM -0600, Shuah Khan wrote: > > > > > They don't add any new behavior, As Kees mentioned they do g

Re: [PATCH] sched/wait: introduce wait_event_freezable_hrtimeout

2019-01-18 Thread Peter Zijlstra
On Fri, Jan 18, 2019 at 10:19:41AM -0500, Joel Fernandes wrote: > You should document the variable names in the header comments. > > Also, this new API appears to conflict with definition of 'freezable' in > wait_event_freezable I think, > > wait_event_freezable - sleep or freeze until condition

Re: [RFC PATCH] x86, hyperv: fix kernel panic when kexec on HyperV VM

2019-02-27 Thread Peter Zijlstra
On Tue, Feb 26, 2019 at 11:56:15PM +0800, Kairui Song wrote: > arch/x86/hyperv/hv_init.c | 4 > 1 file changed, 4 insertions(+) > > diff --git a/arch/x86/hyperv/hv_init.c b/arch/x86/hyperv/hv_init.c > index 7abb09e2eeb8..92291c18d716 100644 > --- a/arch/x86/hyperv/hv_init.c > +++ b/arch/x86/

Re: [RFC PATCH] x86, hyperv: fix kernel panic when kexec on HyperV VM

2019-03-05 Thread Peter Zijlstra
On Wed, Feb 27, 2019 at 10:55:46PM +0800, Kairui Song wrote: > On Wed, Feb 27, 2019 at 8:02 PM Peter Zijlstra wrote: > > > > On Tue, Feb 26, 2019 at 11:56:15PM +0800, Kairui Song wrote: > > > arch/x86/hyperv/hv_init.c | 4 > > > 1 file changed, 4 insertions

Re: [PATCH v2] x86, hyperv: fix kernel panic when kexec on HyperV

2019-03-05 Thread Peter Zijlstra
On Tue, Mar 05, 2019 at 08:17:03PM +0800, Kairui Song wrote: > diff --git a/arch/x86/hyperv/hv_init.c b/arch/x86/hyperv/hv_init.c > index 7abb09e2eeb8..34aa1e953dfc 100644 > --- a/arch/x86/hyperv/hv_init.c > +++ b/arch/x86/hyperv/hv_init.c > @@ -406,6 +406,12 @@ void hyperv_cleanup(void) > /*

Re: [PATCH v2] x86, hyperv: fix kernel panic when kexec on HyperV

2019-03-05 Thread Peter Zijlstra
On Tue, Mar 05, 2019 at 09:34:13PM +0800, Kairui Song wrote: > On Tue, Mar 5, 2019 at 8:33 PM Peter Zijlstra wrote: > > > > On Tue, Mar 05, 2019 at 08:17:03PM +0800, Kairui Song wrote: > > > diff --git a/arch/x86/hyperv/hv_init.c b/arch/x86/hyperv/hv_init.c > > >

Re: [PATCH 00/34] put_user_pages(): miscellaneous call sites

2019-08-02 Thread Peter Zijlstra
On Thu, Aug 01, 2019 at 07:16:19PM -0700, john.hubb...@gmail.com wrote: > This is part a tree-wide conversion, as described in commit fc1d8e7cca2d > ("mm: introduce put_user_page*(), placeholder versions"). That commit > has an extensive description of the problem and the planned steps to > solve

Re: Inconsistent lock state with Hyper-V memory balloon?

2014-11-10 Thread Peter Zijlstra
On Sat, Nov 08, 2014 at 02:36:54PM +, Sitsofe Wheeler wrote: > I've been trying to use the Hyper-V balloon driver to allow the host to > reclaim unused memory but have been hitting issues. With a Hyper-V 2012 > R2 guest with 4GBytes of RAM, dynamic memory on, 1GByte minimum 10GByte > maximum, 8

Re: [PATCH] x86/hyperv: Disable preemption while setting reenlightenment vector

2019-06-12 Thread Peter Zijlstra
On Tue, Jun 11, 2019 at 10:20:03PM +0100, Dmitry Safonov wrote: > KVM support may be compiled as dynamic module, which triggers the > following splat on modprobe: > > KVM: vmx: using Hyper-V Enlightened VMCS > BUG: using smp_processor_id() in preemptible [] code: modprobe/466 > caller i

Re: [PATCH] x86/hyperv: Disable preemption while setting reenlightenment vector

2019-06-14 Thread Peter Zijlstra
On Wed, Jun 12, 2019 at 12:17:24PM +0200, Vitaly Kuznetsov wrote: > Dmitry Safonov writes: > > > KVM support may be compiled as dynamic module, which triggers the > > following splat on modprobe: > > > > KVM: vmx: using Hyper-V Enlightened VMCS > > BUG: using smp_processor_id() in preemptible [

Re: [PATCH] x86/hyperv: Disable preemption while setting reenlightenment vector

2019-06-14 Thread Peter Zijlstra
On Fri, Jun 14, 2019 at 12:50:51PM +0100, Dmitry Safonov wrote: > On 6/14/19 11:08 AM, Vitaly Kuznetsov wrote: > > Peter Zijlstra writes: > > > >> @@ -182,7 +182,7 @@ void set_hv_tscchange_cb(void (*cb)(void)) > >>struct hv_reenlightenment_control re

Re: [PATCH v3 5/6] ANDROID: binder: don't check prio permissions on restore.

2017-11-15 Thread Peter Zijlstra
On Thu, Oct 26, 2017 at 04:07:49PM +0200, Martijn Coenen wrote: > Because we have disabled RT priority inheritance for > the regular binder domain, the following can happen: > > 1) thread A (prio 98) calls into thread B > 2) because RT prio inheritance is disabled, thread B >runs at the lowest

Re: [PATCH v3 2/6] ANDROID: binder: add min sched_policy to node.

2017-11-15 Thread Peter Zijlstra
On Thu, Oct 26, 2017 at 04:07:46PM +0200, Martijn Coenen wrote: > This change adds flags to flat_binder_object.flags > to allow indicating a minimum scheduling policy for > the node. It also clarifies the valid value range > for the priority bits in the flags. > > Internally, we use the priority m

Re: [PATCH v3 1/6] ANDROID: binder: add support for RT prio inheritance.

2017-11-15 Thread Peter Zijlstra
On Thu, Oct 26, 2017 at 04:07:45PM +0200, Martijn Coenen wrote: > +/** > + * binder_set_priority() - sets the scheduler priority of a task > + * @task:task to set priority on > + * @desired: desired priority to run at > + * > + * The scheduler policy of tasks is changed explicitly, because we w

Re: [PATCH v3 4/6] ANDROID: binder: add RT inheritance flag to node.

2017-11-15 Thread Peter Zijlstra
On Thu, Oct 26, 2017 at 04:07:48PM +0200, Martijn Coenen wrote: > Allows a binder node to specify whether it wants to > inherit real-time scheduling policy from a caller. This > inheritance may not always be desirable, for example in > cases where the binder call runs untrusted and therefore > pote

Re: [PATCH v3 3/6] ANDROID: binder: improve priority inheritance.

2017-11-15 Thread Peter Zijlstra
On Thu, Oct 26, 2017 at 04:07:47PM +0200, Martijn Coenen wrote: > By raising the priority of a thread selected for > a transaction *before* we wake it up. > > Delay restoring the priority when doing a reply > until after we wake-up the process receiving > the reply. What happens if a thread dies?

Re: [PATCH v3 1/6] ANDROID: binder: add support for RT prio inheritance.

2017-11-16 Thread Peter Zijlstra
> On Wed, Nov 15, 2017 at 2:01 PM, Peter Zijlstra wrote: > >> + * 1) binder supports a "minimum node priority", meaning that all > >> transactions > >> + *into a node must run at this priority at a minimum. This means that > >> the > &g

Re: [PATCH v3 1/6] ANDROID: binder: add support for RT prio inheritance.

2017-11-16 Thread Peter Zijlstra
On Thu, Nov 16, 2017 at 02:03:13PM +0100, Martijn Coenen wrote: > On Thu, Nov 16, 2017 at 12:27 PM, Peter Zijlstra wrote: > > But that's exactly what you get!? How would it ever get below > > min_node_prio? PI only ever (temporarily) raises prio, it never lowers > > i

Re: Will the name of hyperv_clocksource_tsc_page or hyperv_clocksource pages change?

2018-06-22 Thread Peter Zijlstra
On Fri, Jun 22, 2018 at 03:17:25AM +, Alma Eyre (Sonata Software North America) wrote: > Hello, > > This is Alma supporting Azure for Japanese customers. I had a question > from a customer that I could not find the answers for. I saw this > github(https://github.com/torvalds/linux/commit/88c9

Re: [PATCH 1/2] cpu-hotplug: export cpu_hotplug_enable/cpu_hotplug_disable

2015-05-19 Thread Peter Zijlstra
On Tue, May 19, 2015 at 02:15:41PM +0200, Vitaly Kuznetsov wrote: > Loaded Hyper-V module will use these functions to disable CPU hotplug > under certain circumstances. What's wrong with get_online_cpus() ? ___ devel mailing list de...@linuxdriverproject

Re: [PATCH 1/1] cpu-hotplug: export cpu_hotplug_enable/cpu_hotplug_disable

2015-06-23 Thread Peter Zijlstra
On Tue, Jun 23, 2015 at 04:57:05PM +, KY Srinivasan wrote: > > diff --git a/kernel/cpu.c b/kernel/cpu.c > > index 94bbe46..8f35ee6 100644 > > --- a/kernel/cpu.c > > +++ b/kernel/cpu.c > > @@ -190,17 +190,19 @@ void cpu_hotplug_done(void) > > void cpu_hotplug_disable(void) > > { > > cpu_m

Re: [PATCH 1/1] cpu-hotplug: export cpu_hotplug_enable/cpu_hotplug_disable

2015-06-24 Thread Peter Zijlstra
On Wed, Jun 24, 2015 at 11:43:33AM +0200, Vitaly Kuznetsov wrote: > Peter Zijlstra writes: > > On Tue, Jun 23, 2015 at 04:57:05PM +, KY Srinivasan wrote: > > > >> > diff --git a/kernel/cpu.c b/kernel/cpu.c > >> > index 94bbe46..8f35ee6 100644 > &

Re: [PATCH] android: binder: Disable preemption while holding the global binder lock

2016-09-10 Thread Peter Zijlstra
On Sat, Sep 10, 2016 at 09:16:59AM -0700, Christoph Hellwig wrote: > On Thu, Sep 08, 2016 at 09:12:50AM -0700, Todd Kjos wrote: > > In Android systems, the display pipeline relies on low > > latency binder transactions and is therefore sensitive to > > delays caused by contention for the global bin

Re: [PATCH] android: binder: Disable preemption while holding the global binder lock

2016-09-13 Thread Peter Zijlstra
On Mon, Sep 12, 2016 at 08:44:09PM -0700, Arve Hjønnevåg wrote: > A previous attempt to fix this problem, changed the lock to use > rt_mutex instead of mutex, but this apparently did not work as well as > this patch. I believe the added overhead was noticeable, and it did > not work when the preem

Re: [PATCH] android: binder: Disable preemption while holding the global binder lock

2016-09-14 Thread Peter Zijlstra
On Tue, Sep 13, 2016 at 12:53:27PM -0700, Arve Hjønnevåg wrote: > On Tue, Sep 13, 2016 at 12:32 AM, Peter Zijlstra wrote: > > On Mon, Sep 12, 2016 at 08:44:09PM -0700, Arve Hjønnevåg wrote: > > > >> A previous attempt to fix this problem, changed the lock to use > &

Re: [PATCH] android: binder: Disable preemption while holding the global binder lock

2016-09-14 Thread Peter Zijlstra
On Wed, Sep 14, 2016 at 09:10:01AM +0200, Peter Zijlstra wrote: > We could define a meaningful something for CFS and implement that, but > it isn't currently done. So the generalization of the Priority Inheritance Protocol is Proxy Execution Protocol, which basically lets the boost

Re: [PATCH] android: binder: Disable preemption while holding the global binder lock

2016-09-14 Thread Peter Zijlstra
On Wed, Sep 14, 2016 at 09:10:01AM +0200, Peter Zijlstra wrote: > On Tue, Sep 13, 2016 at 12:53:27PM -0700, Arve Hjønnevåg wrote: > > Most of the tasks here are not RR/FIFO/DL tasks. I don't see anything > > in the rtmutex code or documentation that indicates that they don&#

Re: [PATCH] android: binder: Disable preemption while holding the global binder lock

2016-09-14 Thread Peter Zijlstra
On Tue, Sep 13, 2016 at 12:53:27PM -0700, Arve Hjønnevåg wrote: > On Tue, Sep 13, 2016 at 12:32 AM, Peter Zijlstra wrote: > > cgroups should be irrelevant, PI is unaware of them. > > I don't think cgroups are irrelevant. PI being unaware of them > explains the problem I

Re: [PATCH] android: binder: Disable preemption while holding the global binder lock

2016-09-14 Thread Peter Zijlstra
On Wed, Sep 14, 2016 at 06:11:03PM +0200, Peter Zijlstra wrote: > On Tue, Sep 13, 2016 at 12:53:27PM -0700, Arve Hjønnevåg wrote: > > On Tue, Sep 13, 2016 at 12:32 AM, Peter Zijlstra > > wrote: > > > cgroups should be irrelevant, PI is unaware of them. > >

Re: [PATCH] android: binder: Disable preemption while holding the global binder lock

2016-09-14 Thread Peter Zijlstra
On Wed, Sep 14, 2016 at 06:13:40PM +0200, Peter Zijlstra wrote: > On Wed, Sep 14, 2016 at 06:11:03PM +0200, Peter Zijlstra wrote: > > On Tue, Sep 13, 2016 at 12:53:27PM -0700, Arve Hjønnevåg wrote: > > > On Tue, Sep 13, 2016 at 12:32 AM, Peter Zijlstra > > > wrote

Re: [PATCH v2 03/13] ANDROID: binder: add support for RT prio inheritance.

2017-08-31 Thread Peter Zijlstra
On Thu, Aug 31, 2017 at 10:04:20AM +0200, Martijn Coenen wrote: > Adds support for SCHED_BATCH/SCHED_FIFO/SCHED_RR priority inheritance > to the binder driver. The desired behavior is as follows: You fail to support SCHED_DEADLINE, that's not optional. _

Re: [PATCH v2 03/13] ANDROID: binder: add support for RT prio inheritance.

2017-08-31 Thread Peter Zijlstra
On Thu, Aug 31, 2017 at 10:27:58AM +0200, Martijn Coenen wrote: > On Thu, Aug 31, 2017 at 10:18 AM, Peter Zijlstra wrote: > > You fail to support SCHED_DEADLINE, that's not optional. > > The reason I didn't include it is that we don't use SCHED_DEADLINE in > Andr

Re: [PATCH v2 03/13] ANDROID: binder: add support for RT prio inheritance.

2017-08-31 Thread Peter Zijlstra
On Thu, Aug 31, 2017 at 02:00:54PM +0200, Martijn Coenen wrote: > Appreciate if you could take a look! In particular I'm curious why > this approach is considered "dodgy", or "engineered sideways" as > Thomas pointed out earlier. The fact that you could not reuse rt_mutex makes me very nervous. O

Re: [PATCH 0/3] Modernize tasklet callback API

2020-07-16 Thread Peter Zijlstra
On Wed, Jul 15, 2020 at 08:08:44PM -0700, Kees Cook wrote: > Hi, > > This is the infrastructure changes to prepare the tasklet API for > conversion to passing the tasklet struct as the callback argument instead > of an arbitrary unsigned long. The first patch details why this is useful > (it's the