Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755111AbbDOKiF (ORCPT ); Wed, 15 Apr 2015 06:38:05 -0400 Received: from e36.co.us.ibm.com ([32.97.110.154]:55206 "EHLO e36.co.us.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753386AbbDOKh4 (ORCPT ); Wed, 15 Apr 2015 06:37:56 -0400 Message-ID: <552E3F4F.5030004@linux.vnet.ibm.com> Date: Wed, 15 Apr 2015 16:07:03 +0530 From: Preeti U Murthy User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 MIME-Version: 1.0 To: Jason Low , Linus Torvalds , Peter Zijlstra , Ingo Molnar , Thomas Gleixner CC: linux-kernel@vger.kernel.org, "Paul E. McKenney" , Andrew Morton , Oleg Nesterov , Mike Galbraith , Frederic Weisbecker , Mel Gorman , Steven Rostedt , hideaki.kimura@hp.com, Aswin Chandramouleeswaran , Scott J Norton Subject: Re: [PATCH 2/3] sched, timer: Use atomics for thread_group_cputimer to improve scalability References: <1429052986-9420-1-git-send-email-jason.low2@hp.com> <1429052986-9420-3-git-send-email-jason.low2@hp.com> In-Reply-To: <1429052986-9420-3-git-send-email-jason.low2@hp.com> Content-Type: text/plain; charset=ISO-8859-6 Content-Transfer-Encoding: 7bit X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 15041510-0021-0000-0000-000009D98DED Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1355 Lines: 40 On 04/15/2015 04:39 AM, Jason Low wrote: > /* > @@ -885,11 +890,8 @@ static void check_thread_timers(struct task_struct *tsk, > static void stop_process_timers(struct signal_struct *sig) > { > struct thread_group_cputimer *cputimer = &sig->cputimer; > - unsigned long flags; > > - raw_spin_lock_irqsave(&cputimer->lock, flags); > - cputimer->running = 0; > - raw_spin_unlock_irqrestore(&cputimer->lock, flags); > + WRITE_ONCE(cputimer->running, 0); Why do a WRITE_ONCE() here ? Maybe you should explicitly mention this through a comment like Steven pointed out about all WRITE/READ/ACCESS_ONCE() usage. Regards Preeti U Murthy > } > > static u32 onecputick; > @@ -1114,9 +1116,7 @@ static inline int fastpath_timer_check(struct task_struct *tsk) > if (sig->cputimer.running) { > struct task_cputime group_sample; > > - raw_spin_lock(&sig->cputimer.lock); > - group_sample = sig->cputimer.cputime; > - raw_spin_unlock(&sig->cputimer.lock); > + sample_group_cputimer(&group_sample, &sig->cputimer); > > if (task_cputime_expired(&group_sample, &sig->cputime_expires)) > return 1; > -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/