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
| ||
|
Date: Mon, 4 Apr 2016 14:09:31 -0500 (CDT) From: Christoph Lameter <cl@...ux.com> To: Waiman Long <waiman.long@....com> cc: Nikolay Borisov <kernel@...p.com>, Theodore Ts'o <tytso@....edu>, Andreas Dilger <adilger.kernel@...ger.ca>, Tejun Heo <tj@...nel.org>, linux-ext4@...r.kernel.org, linux-kernel@...r.kernel.org, Scott J Norton <scott.norton@....com>, Douglas Hatch <doug.hatch@....com>, Toshimitsu Kani <toshi.kani@....com> Subject: Re: [PATCH 2/3] percpu_stats: Simple per-cpu statistics count helper functions On Mon, 4 Apr 2016, Waiman Long wrote: > > > + if ((unsigned int)stat>= pcs->nstats) > > > + return; > > > + preempt_disable(); > > > + pstat = this_cpu_ptr(&pcs->stats[stat]); > > > + *pstat += cnt; > > > + preempt_enable(); > > > +} > > pstat = get_cpu_ptr(&pcs->stats[stat]); > > *pstat += cnt; > > put_cpu_ptr(&pcs->stats[stat]); > > > > It will generate identical code but this one uses APIs, making the > > intention clearer. But as I said this is just a minor nit. > > > > you can add my Reviewed-by: Nikolay Borisov<kernel@...p.com> for this > > particular patch. > > Yes, that will certainly make it look nicer. I will update the patch once I > get feedback from my other ext4 patches. Why not this_cpu_add(pci->stats[stat], cnt) This is a single instruction on x86. -- To unsubscribe from this list: send the line "unsubscribe linux-ext4" in the body of a message to majordomo@...r.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists