lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20201119113352.GM3121378@hirez.programming.kicks-ass.net>
Date:   Thu, 19 Nov 2020 12:33:52 +0100
From:   Peter Zijlstra <peterz@...radead.org>
To:     Thomas Gleixner <tglx@...utronix.de>
Cc:     LKML <linux-kernel@...r.kernel.org>, x86@...nel.org,
        Linus Torvalds <torvalds@...uxfoundation.org>,
        Christoph Hellwig <hch@....de>,
        Matthew Wilcox <willy@...radead.org>,
        Daniel Vetter <daniel@...ll.ch>,
        Andrew Morton <akpm@...ux-foundation.org>, linux-mm@...ck.org,
        Linus Torvalds <torvalds@...ux-foundation.org>,
        Ingo Molnar <mingo@...nel.org>,
        Juri Lelli <juri.lelli@...hat.com>,
        Vincent Guittot <vincent.guittot@...aro.org>,
        Dietmar Eggemann <dietmar.eggemann@....com>,
        Steven Rostedt <rostedt@...dmis.org>,
        Ben Segall <bsegall@...gle.com>, Mel Gorman <mgorman@...e.de>,
        Daniel Bristot de Oliveira <bristot@...hat.com>
Subject: Re: [patch V4 5/8] sched: highmem: Store local kmaps in task struct

On Wed, Nov 18, 2020 at 08:48:43PM +0100, Thomas Gleixner wrote:
> @@ -4073,6 +4089,7 @@ prepare_task_switch(struct rq *rq, struc
>  	perf_event_task_sched_out(prev, next);
>  	rseq_preempt(prev);
>  	fire_sched_out_preempt_notifiers(prev, next);
> +	kmap_local_sched_out();
>  	prepare_task(next);
>  	prepare_arch_switch(next);
>  }
> @@ -4139,6 +4156,7 @@ static struct rq *finish_task_switch(str
>  	finish_lock_switch(rq);
>  	finish_arch_post_lock_switch();
>  	kcov_finish_switch(current);
> +	kmap_local_sched_in();

This is asymmetric and deserves a comment. You do the sched_out with
IRQs disabled and rq->lock held, but do the sched_in with IRQs enabled
and rq->lock released.

I suppose doing it here reduces IRQ latency by however long it takes to
update and invalidate that handful of pages, is that worth the
asymmetry?

It mirrors preempt_notifiers I suppose, and they actually rely on this
asymmetry for something IIRC.

>  	fire_sched_in_preempt_notifiers(current);
>  	/*

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ