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] [day] [month] [year] [list]
Date:	Mon, 9 Feb 2009 15:50:00 -0700
From:	Alex Chiang <achiang@...com>
To:	"Paul E. McKenney" <paulmck@...ux.vnet.ibm.com>
Cc:	tony.luck@...el.com, linux-ia64@...r.kernel.org,
	linux-kernel <linux-kernel@...r.kernel.org>
Subject: Re: RCU can use cpu_active_map?

* Paul E. McKenney <paulmck@...ux.vnet.ibm.com>:
> On Mon, Feb 09, 2009 at 01:13:45PM -0700, Alex Chiang wrote:
> > Paul,
> > 
> > I don't pretend to understand RCU, but a very quick and naive
> > look through rcupreempt.c makes me think that we could use the
> > cpu_active_map instead of cpu_online_map?
> > 
> > cpu_active_map was introduced by e761b772.
> > 
> > In the CPU hotplug path, we touch the cpu_active_map very early
> > on:
> > 
> > int __ref cpu_down(unsigned int cpu)
> > {
> >         int err;
> >         err = stop_machine_create();
> >         if (err)
> >                 return err;
> >         cpu_maps_update_begin();
> > 
> >         if (cpu_hotplug_disabled) {
> >                 err = -EBUSY;
> >                 goto out;
> >         }
> > 
> >         cpu_clear(cpu, cpu_active_map);
> > 	/* ... */
> >         synchronize_sched();
> >         err = _cpu_down(cpu, 0);
> >         if (cpu_online(cpu))
> >                 cpu_set(cpu, cpu_active_map);
> > 
> > out:
> >         cpu_maps_update_done();
> >         stop_machine_destroy();
> >         return err;
> > }
> > 
> > The call to _cpu_down() is where we eventually get to the code
> > that my patch below touches, so you can see that we mark the CPU
> > as !active before we ever get to the step of migrating interrupts
> > (which relies on cpu_online_map).
> > 
> > If RCU looked at cpu_active_map instead of cpu_online_map, it
> > seems like we would avoid the potential race situation you
> > mentioned earlier.
> > 
> > Alternatively, I could explore just playing with the ia64
> > interrupt migration code to use cpu_active_mask instead, but
> > wanted to get your thoughts from the RCU perspective.
> 
> Perhaps I am confused, but if the CPU is on its way down, doesn't RCU
> need a mask where the CPU's bit stays set longer rather than shorter?
> 
> If I use cpu_active_mask, couldn't there be device interrupts during
> (for example) the synchronize_sched(), which might have RCU read-side
> critical sections that RCU needs to pay attention to?

Hm, I think you're right.

Thanks.

/ac

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ