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]
Date:	Wed, 29 Apr 2015 11:25:05 -0700
From:	Jason Low <jason.low2@...com>
To:	Steven Rostedt <rostedt@...dmis.org>
Cc:	Waiman Long <waiman.long@...com>,
	Peter Zijlstra <peterz@...radead.org>,
	Ingo Molnar <mingo@...nel.org>,
	Thomas Gleixner <tglx@...utronix.de>,
	linux-kernel@...r.kernel.org,
	"Paul E. McKenney" <paulmck@...ux.vnet.ibm.com>,
	Andrew Morton <akpm@...ux-foundation.org>,
	Oleg Nesterov <oleg@...hat.com>,
	Frederic Weisbecker <fweisbec@...il.com>,
	Mel Gorman <mgorman@...e.de>, Rik van Riel <riel@...hat.com>,
	Preeti U Murthy <preeti@...ux.vnet.ibm.com>,
	Mike Galbraith <umgwanakikbuti@...il.com>,
	Davidlohr Bueso <dave@...olabs.net>,
	Aswin Chandramouleeswaran <aswin@...com>,
	Scott J Norton <scott.norton@...com>, jason.low2@...com
Subject: Re: [PATCH v2 1/5] sched, timer: Remove usages of ACCESS_ONCE in
 the scheduler

On Wed, 2015-04-29 at 13:15 -0400, Steven Rostedt wrote:
> On Wed, 29 Apr 2015 13:05:55 -0400
> Waiman Long <waiman.long@...com> wrote:
> 
> > >   		goto no_join;
> > > @@ -2107,7 +2107,7 @@ void task_numa_fault(int last_cpupid, int mem_node, int pages, int flags)
> > >
> > >   static void reset_ptenuma_scan(struct task_struct *p)
> > >   {
> > > -	ACCESS_ONCE(p->mm->numa_scan_seq)++;
> > > +	WRITE_ONCE(p->mm->numa_scan_seq, READ_ONCE(p->mm->numa_scan_seq) + 1);
> > >   	p->mm->numa_scan_offset = 0;
> > >   }
> > >
> > >
> > 
> > Generally, I am for replacing ACCESS_ONCE() with the more descriptive 
> > READ_ONCE() and WRITE_ONCE() except the above case where it makes the 
> > code harder to read without any real advantage.
> > 
> > Other than that,
> > 
> > Acked-by: Waiman Long <Waiman.Long@...com>
> > 
> 
> I agree, but I believe this code needs to be updated anyway. Making it
> uglier may encourage that to happen.

Yep, in this case, the ACCESS_ONCE conversion on numa_scan_seq
technically isn't necessary, but I think the best option is to
consistently update all of them, which makes things clearer than using
multiple sets of APIs.

Thanks,
Jason

--
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