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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Thu, 2 May 2019 17:10:55 +0200
From:   Ingo Molnar <mingo@...nel.org>
To:     Sebastian Andrzej Siewior <bigeasy@...utronix.de>
Cc:     linux-kernel@...r.kernel.org,
        Peter Zijlstra <peterz@...radead.org>,
        Thomas Gleixner <tglx@...utronix.de>
Subject: Re: [PATCH] sched: Provide a pointer to the valid CPU mask


* Sebastian Andrzej Siewior <bigeasy@...utronix.de> wrote:

> In commit 4b53a3412d66 ("sched/core: Remove the tsk_nr_cpus_allowed()
> wrapper") the tsk_nr_cpus_allowed() wrapper was removed. There was not
> much difference in !RT but in RT we used this to implement
> migrate_disable(). Within a migrate_disable() section the CPU mask is
> restricted to single CPU while the "normal" CPU mask remains untouched.
> 
> As an alternative implementation Ingo suggested to use
> 	struct task_struct {
> 		const cpumask_t		*cpus_ptr;
> 		cpumask_t		cpus_mask;
>         };
> with
> 	t->cpus_allowed_ptr = &t->cpus_allowed;
> 
> In -RT we then can switch the cpus_ptr to
> 	t->cpus_allowed_ptr = &cpumask_of(task_cpu(p));
> 
> in a migration disabled region. The rules are simple:
> - Code that 'uses' ->cpus_allowed would use the pointer.
> - Code that 'modifies' ->cpus_allowed would use the direct mask.
> 
> I proposed this patch as a series earlier and it was shutdown due to the
> migrate_disable() bits. It has been said that migrate_disable() should
> only be used with RT and thus not introduced without it.
> I hereby propose only the mask CPU-bits.
> 
> Cc: Peter Zijlstra <peterz@...radead.org>
> Cc: Thomas Gleixner <tglx@...utronix.de>
> Cc: Ingo Molnar <mingo@...nel.org>
> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@...utronix.de>
> ---
>  arch/ia64/kernel/mca.c                     |  2 +-
>  arch/mips/include/asm/switch_to.h          |  4 +--
>  arch/mips/kernel/mips-mt-fpaff.c           |  2 +-
>  arch/mips/kernel/traps.c                   |  6 ++--
>  arch/powerpc/platforms/cell/spufs/sched.c  |  2 +-
>  arch/x86/kernel/cpu/resctrl/pseudo_lock.c  |  2 +-
>  drivers/infiniband/hw/hfi1/affinity.c      |  6 ++--
>  drivers/infiniband/hw/hfi1/sdma.c          |  3 +-
>  drivers/infiniband/hw/qib/qib_file_ops.c   |  7 ++--
>  fs/proc/array.c                            |  4 +--
>  include/linux/sched.h                      |  5 +--
>  init/init_task.c                           |  3 +-
>  kernel/cgroup/cpuset.c                     |  2 +-
>  kernel/fork.c                              |  2 ++
>  kernel/sched/core.c                        | 40 +++++++++++-----------
>  kernel/sched/cpudeadline.c                 |  4 +--
>  kernel/sched/cpupri.c                      |  4 +--
>  kernel/sched/deadline.c                    |  6 ++--
>  kernel/sched/fair.c                        | 34 +++++++++---------
>  kernel/sched/rt.c                          |  4 +--
>  kernel/trace/trace_hwlat.c                 |  2 +-
>  lib/smp_processor_id.c                     |  2 +-
>  samples/trace_events/trace-events-sample.c |  2 +-
>  23 files changed, 75 insertions(+), 73 deletions(-)

Looks good to me in principle - Peter, Thomas, any fundamental 
objections?

Thanks,

	Ingo

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ