From: "Jan Beulich" Subject: Re: [PATCH] introduce and used relaxed cpumask operations Date: Wed, 21 Jan 2015 14:10:37 +0000 Message-ID: <54BFC16D0200007800057B3B@mail.emea.novell.com> References: <54BD379C0200007800056965@mail.emea.novell.com> <54BF99D1.9050709@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1YDvzV-0007RE-3p for xen-devel@lists.xenproject.org; Wed, 21 Jan 2015 14:10:41 +0000 In-Reply-To: <54BF99D1.9050709@citrix.com> Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Andrew Cooper Cc: Keir Fraser , George Dunlap , Ian Jackson , Tim Deegan , IanCampbell , xen-devel List-Id: xen-devel@lists.xenproject.org >>> On 21.01.15 at 13:21, wrote: > On 19/01/15 15:58, Jan Beulich wrote: >> --- a/xen/common/core_parking.c >> +++ b/xen/common/core_parking.c >> @@ -75,11 +75,10 @@ static unsigned int core_parking_perform >> if ( core_weight < core_tmp ) >> { >> core_weight = core_tmp; >> - cpumask_clear(&core_candidate_map); >> - cpumask_set_cpu(cpu, &core_candidate_map); >> + cpumask_copy(&core_candidate_map, cpumask_of(cpu)); > > It is probably worth mentioning changes like this in the commit message, > as they are slightly more than just a simple removal of the lock prefix. Added. >> +static inline void __cpumask_clr_cpu(int cpu, cpumask_t *dstp) >> +{ >> + __clear_bit(cpumask_check(cpu), dstp->bits); >> +} >> + > > While I can appreciate the want for a shorter function name, I feel that > consistency with its locked alternative is more important. I sort of expected a comment to that effect, but decided to use the shorter names nevertheless. Let's see what others, namely the REST maintainers, say. >> -static inline int cpumask_test_and_set_cpu(int cpu, cpumask_t *addr) >> +static inline int cpumask_test_and_set_cpu(int cpu, volatile cpumask_t *addr) >> { >> return test_and_set_bit(cpumask_check(cpu), addr->bits); >> } >> >> -static inline int cpumask_test_and_clear_cpu(int cpu, cpumask_t *addr) >> +static inline int __cpumask_tst_set_cpu(int cpu, cpumask_t *addr) >> +{ >> + return __test_and_set_bit(cpumask_check(cpu), addr->bits); >> +} >> + >> +static inline int cpumask_test_and_clear_cpu(int cpu, volatile cpumask_t *addr) > > This introduction of volatile also need mentioning in the commit > message, but I would agree that it should be here. Done too. Jan