tech-kern archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: RFC: New userspace fetch/store API
> Memory store to initialize error
Heh. Well spotted.
> Itâ??s 2 loads and a store in either case, [...]
...though one does better when there _are_ multiple calls whose error
checks can be collapsed.
> and the second pattern is contrary to just about everything else in
> the kernel.
True, though many, perhaps most, of those patterns are historical
relics from the days when memory references were comparatively cheap.
This is not to say that they necessarily should be discarded, just that
"It's Tradition!" is not necessarily a conversation-closer.
> Nevermind that itâ??s patently absurd to be micro-optimizing this
> particular thing because it completely ignores all of the other stuff
> that these routines do behind the curtain that absolutely dwarfs what
> weâ??re talking about here.
True enough.
Personally, I am less concerned about fixing this particular case than
I am about fixing the mental attitudes and habits that led to it (to
the extent that "fixing" is an appropriate word, of course). My own
preference, here, would be the suggestion I saw upthread about
returning a struct. There seems to be a resistance to using structs by
value; I speculate that it is largely holdover from the days when
structs by value were expensive, with perhaps some from the even older
days when structs by value weren't even supported yet. The struct is
easily the fewest memory references of anything I've seen suggested,
and I see no reason to avoid it except habit.
/~\ The ASCII Mouse
\ / Ribbon Campaign
X Against HTML mouse%rodents-montreal.org@localhost
/ \ Email! 7D C8 61 52 5D E7 2D 39 4E F1 31 3E E8 B3 27 4B
Home |
Main Index |
Thread Index |
Old Index