public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Ray Bryant <raybry@sgi.com>
To: William Lee Irwin III <wli@holomorphy.com>
Cc: Paul Jackson <pj@sgi.com>,
	colpatch@us.ibm.com, linux-kernel@vger.kernel.org, akpm@osdl.org,
	Jesse Barnes <jbarnes@sgi.com>, John Hawkes <hawkes@sgi.com>
Subject: Re: [PATCH] mask ADT: new mask.h file [2/22]
Date: Tue, 30 Mar 2004 18:16:45 -0600	[thread overview]
Message-ID: <406A0DED.8090906@sgi.com> (raw)
In-Reply-To: <20040330101952.GN791@holomorphy.com>

wli,

I do apologize for not following this discussion until now.  Mu mailer was happily filing these 
messages away for me in a folder and I hadn't noticed the subject line.  Paul Jackson called me to 
discuss this and we've run a few test cases to understand the impact of call by value versus call by 
reference implementations.  We've discovered a couple interesting things:

(1)  As near as we can tell, there are only 3 routines that appear to have cpumask_t arguments in 
the Linux 2.6.4 kernel that are also called often enough that it might matter.  All of these 
routines live in sched.c:  load_balance(), find_busiest_queue(), and set_cpus_allowed().  The first 
two of these routines are called on the order of once every few 10s of milliseconds, at least on our 
machines, so they don't really represent a huge load on the system even if they do impose some extra 
instructions due to call by value instead of call by reference.  The last one is probably called 
even less often, so from the standpoint of these routines we can't make a case for requring call by 
reference.

(2)  The base routines that actually do the bit manipulation appear all to be call by reference in 
any case.  So that is a good thing.  It would be silly to copy an 8 word (or larger??) mask into 
registers just to set a single bit.

(3)  The current compilers appear to be somewhat better at managing these call by value structures 
than the ones I was experimenting with last summer.

As I recall our discussion on this of last summer, I think the notion was to get the call by 
reference stuff into 2.6 and then evaluate later what the break even point was (i. e. at how many 
words of cpumask does it become more efficient to use call by reference).  I think our thinking at 
the present time is that there is no cross over point, that the call by value stuff is good enough 
for all sizes of bitmasks.

Also, since then, Jesse Barnes has become the official maintainer for 2.6-sn.  So all such decisions 
need to be blessed by him.  That will, in part, reduce the inherent noise level of having several 
different SGI folks broadcasting requirements out into the community.

Paul's point to me was that while the transparency of the call by value versus call by reference 
approach was virtually transparent (perhaps translucent?) at the source code level, it did introduce 
some complexity that could be confusing.  Perhaps a better approach might be to explicitly code the 
3 routines mentioned above to take a pointer to bitmask argument, and then we would be done. 
(Certainly on a UP machine this makes little difference, and I would be surprised if we could 
measure the difference on a 32 way IA32 box.)

So, assuming all of the above is correct, I guess I am willing to remove the call by reference 
requirement that I was harping on so much last summer.

Jesse do you agree?

William Lee Irwin III wrote:

> 
> Maybe so. The requirements were actually three competing/conflicting
> requirements: one from Ray Bryant/SGI for call-by-reference semantics
> available to core API's, one from davem for call-by-value on arithmetic
> types in core API's. There was another imposed for zero indirection on
> small SMP systems you're probably going to have to work harder to get
> an ack on since I don't remember where it came from apart from "on high".
> But it sounds like at least one of the requirement competitors may be
> backing out here. If Ray or other vaguely independent SGI ppl (yes, this
> does need to look like it's more than unilateral) could speak up
> regarding the call-by-reference semantics requirement that would lift a
> third of it. The unwrapped structures was basically davem and tinyboxen,
> and I saw the bit where he lifted the sparc(64) side of that requirement.
> 
> As I see it we have:
> (a) pester more ppl at SGI to get cpumask_const_t requirements dropped
> (b) davem's already backed off cpumask_arith for sparc(32|64) ABI bits
> (c) some kind of high-level ack is needed for indirection on tinyboxen
> 	to kill off the second requirement for cpumask_arith
> (d) run this past arch maintainers for acks wrt. compiler versions vs.
> 	the costructs you're using in inlines
> 
> (a) should be very easy for you, (b) is fait accompli, (c) akpm could
> chime in on at any moment. One hopeful thing here for you is that it's
> a question of asking the right ppl; the code itself is largely a non-
> issue, apart from whether higher-level maintainers regard it as
> excessive code churn or too cleanup-heavy.
> 
> I'll send a private reply about how to get a hold of arch maintainers,
> which should take care of (d).
> 
> (davem please don't shoot me -- this stuff could break things otherwise
> similar to how i386 hit bad codegen in earlier revisions pre-merge)
> 
> 
> -- wli
> 

-- 
Best Regards,
Ray
-----------------------------------------------
                   Ray Bryant
512-453-9679 (work)         512-507-7807 (cell)
raybry@sgi.com             raybry@austin.rr.com
The box said: "Requires Windows 98 or better",
            so I installed Linux.
-----------------------------------------------


  reply	other threads:[~2004-03-31  0:11 UTC|newest]

Thread overview: 47+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-03-29 12:12 [PATCH] mask ADT: new mask.h file [2/22] Paul Jackson
2004-03-30  0:30 ` Matthew Dobson
2004-03-30  0:27   ` Paul Jackson
2004-03-30  1:56     ` Matthew Dobson
2004-03-30  0:47   ` Paul Jackson
2004-03-30  1:53     ` Matthew Dobson
2004-03-30  2:06     ` William Lee Irwin III
2004-03-30  1:31       ` Paul Jackson
2004-03-30  1:27   ` William Lee Irwin III
2004-03-30  1:27     ` Paul Jackson
2004-03-30  6:38       ` William Lee Irwin III
2004-03-30  8:45         ` Paul Jackson
2004-03-30 10:19           ` William Lee Irwin III
2004-03-31  0:16             ` Ray Bryant [this message]
2004-03-31  0:14               ` Jesse Barnes
2004-03-30  2:07     ` William Lee Irwin III
2004-04-01  0:38 ` Matthew Dobson
2004-04-01  0:58   ` Paul Jackson
2004-04-01  1:11     ` Matthew Dobson
2004-04-01  1:18       ` Paul Jackson
2004-04-01  1:27     ` Andrew Morton
2004-04-01  1:35       ` Paul Jackson
2004-04-05  1:26 ` Rusty Russell
2004-04-05  7:05   ` Paul Jackson
2004-04-05  7:42     ` Rusty Russell
2004-04-05  8:08       ` Paul Jackson
2004-04-06  4:59         ` Rusty Russell
2004-04-06  6:06           ` Paul Jackson
2004-04-06  6:23             ` Nick Piggin
2004-04-06  6:34               ` Paul Jackson
2004-04-06  6:49                 ` Nick Piggin
2004-04-06  6:59                   ` Paul Jackson
2004-04-06  7:08                   ` Paul Jackson
2004-04-06  7:03                 ` William Lee Irwin III
2004-04-06  7:33                   ` Paul Jackson
2004-04-06  6:39             ` Rusty Russell
2004-04-06  6:45               ` Paul Jackson
2004-04-06  7:24                 ` Rusty Russell
2004-04-06  7:34                   ` Paul Jackson
2004-04-06 10:40                   ` Paul Jackson
2004-04-07  0:02                     ` Rusty Russell
2004-04-07  1:49                       ` Paul Jackson
2004-04-07  3:55                       ` Paul Jackson
2004-04-06  6:55               ` Nick Piggin
2004-04-06  7:34                 ` Paul Jackson
2004-04-06  7:02               ` Paul Jackson
2004-04-05  7:46     ` 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=406A0DED.8090906@sgi.com \
    --to=raybry@sgi.com \
    --cc=akpm@osdl.org \
    --cc=colpatch@us.ibm.com \
    --cc=hawkes@sgi.com \
    --cc=jbarnes@sgi.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pj@sgi.com \
    --cc=wli@holomorphy.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