mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Mikael Pettersson <mikpe@csd.uu.se>
To: Paul Jackson <pj@sgi.com>
Cc: akpm@osdl.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH][2.6.7-rc3-mm1] perfctr cpumask cleanup
Date: Thu, 10 Jun 2004 11:16:11 +0200	[thread overview]
Message-ID: <16584.9947.222378.506457@alkaid.it.uu.se> (raw)
In-Reply-To: <20040609154750.241df741.pj@sgi.com>

Paul Jackson writes:
 > > Clean up perfctr/virtual by using the new cpus_andnot() operation
 > 
 > Neat.
 > 
 > Do you still need "tmp" ?  Perhaps you could further add the
 > following patch (untested, unbuilt, ...).
 > 
 > This saves copies and stack space for one cpumask (that's
 > 512 bits on my SN2 systems).
 > 
 > Signed-off-by: Paul Jackson <pj@sgi.com>
 > 
 > Index: 2.6.7-rc3-mm1/drivers/perfctr/virtual.c
 > ===================================================================
 > --- 2.6.7-rc3-mm1.orig/drivers/perfctr/virtual.c	2004-06-09 15:34:34.000000000 -0700
 > +++ 2.6.7-rc3-mm1/drivers/perfctr/virtual.c	2004-06-09 15:38:32.000000000 -0700
 > @@ -403,11 +403,10 @@
 >  		return -EFAULT;
 >  
 >  	if (control.cpu_control.nractrs || control.cpu_control.nrictrs) {
 > -		cpumask_t tmp, old_mask, new_mask;
 > +		cpumask_t old_mask, new_mask;
 >  
 > -		tmp = perfctr_cpus_forbidden_mask;
 >  		old_mask = tsk->cpus_allowed;
 > -		cpus_andnot(new_mask, old_mask, tmp);
 > +		cpus_andnot(new_mask, old_mask, perfctr_cpus_forbidden_mask);

Doesn't work because cpus_andnot() requires all three parameters
to be lvalues. In UP and PowerPC builds, perfctr_cpus_forbidden_mask
is #define:d to CPU_MASK_NONE to allow client-side optimisations.

Making it always be a variable will slow down UP and PowerPC with
unoptimisable cpumask tests; alternatively I'll have to wrap my
cpumask uses with optimisation macros and/or #ifdefs.

/Mikael

  reply	other threads:[~2004-06-10  9:48 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-06-09 20:50 Mikael Pettersson
2004-06-09 22:47 ` Paul Jackson
2004-06-10  9:16   ` Mikael Pettersson [this message]
2004-06-10 16:01     ` Paul Jackson
2004-06-10 16:03       ` William Lee Irwin III
2004-06-10 16:11         ` Randy.Dunlap
2004-06-10 16:42         ` Paul Jackson
2004-06-09 22:55 ` Paul Jackson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=16584.9947.222378.506457@alkaid.it.uu.se \
    --to=mikpe@csd.uu.se \
    --cc=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pj@sgi.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®