由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Linux版 - 日哦,Linus 骂娘了
相关主题
读fork.c的时候发现一句脏话linus is a legend..
zan LinusLinux之父:Linux内核体积臃肿要瘦身
Linux基金会重新发布Linux网站According to Linus, Linux Is "Bloated"
Windows还能走多远 (更新)Linus给Windows 7树大拇指
Linus 在 linux.com 发帖了。。。Photo: Linus Celebrates the Windows 7 Launch
Linus Calls Microsoft Hatred "a Disease"GATES和LINUS哪个更伟大?
/.上面的评论笑死有什么高水平的linux/unix论坛或网站推荐吗?
Linux: Linux TTY维护者Alan Cox退出,称“我已经受够了” [ZZ]Open Source 最大的贡献
相关话题的讨论汇总
话题: mask话题: linus话题: 骂娘话题: multiply话题: byte
进入Linux版参与讨论
1 (共1页)
G*****h
发帖数: 33134
c*****e
发帖数: 19
2
领导人都喜欢用 strong language

【在 G*****h 的大作中提到】
: http://www.phoronix.com/image-viewer.php?id=0x2012&image=linus_
A**u
发帖数: 2458
3
你老挖坑

【在 G*****h 的大作中提到】
: http://www.phoronix.com/image-viewer.php?id=0x2012&image=linus_
G*****h
发帖数: 33134
4
的确是骂娘啊

【在 A**u 的大作中提到】
: 你老挖坑
r*********r
发帖数: 3195
5
骂 nvidia 的。
网上有 video.
z****u
发帖数: 3461
6
http://www.youtube.com/watch?v=MShbP3OpASA&feature=player_embed

【在 r*********r 的大作中提到】
: 骂 nvidia 的。
: 网上有 video.

d********u
发帖数: 5383
7
埃,OPEN SOURCE这个圈子里的就喜欢嘴巴爽。有本事自己搞一个吧,又不行。自己翘
不起来,非要怪别人不性感?

【在 G*****h 的大作中提到】
: http://www.phoronix.com/image-viewer.php?id=0x2012&image=linus_
r****c
发帖数: 1494
8
骂得好。
v*****r
发帖数: 1119
9
Linux 在 这个 video 里提到的 micro-optimization 应该是他三月初在 G+ 里贴的问
题,在征求大家的建议 on best code,G+的回复里不乏一些大腕,最后是澳洲的一个
college kid 贴的一行 code 被 Linux 采纳了,linux 的原贴如下:
Linus TorvaldsMar 3, 2012 - Public
More bitwise tricks..
So my quest to calculate the hash and the length of a pathname component
efficiently continues. I'm pretty happy with where I am now (some changes to
the code have happened, it you actually want to see the current situation
you need to check out the kernel mailing list post), but finding the number
of bytes in the final mask bothers me.
Using an explicit loop is out - the branch mispredicts kill it. And while at
least modern Intel CPU's do quite well with just using the bit scan
instructions ("bsf") to find where the first NUL or '/' was in the word,
that sucks on some older CPU's.
So I came up with the following trick to count the number of bytes set in
the byte mask:
/* Low bits set in each byte we used as a mask */
mask &= ONEBYTES;
/* Add up "mask + (mask<<8) + (mask<<16) +... ":
same as a multiply */
mask *= ONEBYTES;
/* High byte now contains count of bits set */
len += mask >> 8*(sizeof(unsigned long)-1);
and I'm wondering if anybody can come up with something that avoids the need
for that multiply (and again - conditionals don't work, the mispredict
costs kill you).
Because that multiply isn't free either.

【在 z****u 的大作中提到】
: http://www.youtube.com/watch?v=MShbP3OpASA&feature=player_embed
S*A
发帖数: 7142
10
And the result code is...


to
number

【在 v*****r 的大作中提到】
: Linux 在 这个 video 里提到的 micro-optimization 应该是他三月初在 G+ 里贴的问
: 题,在征求大家的建议 on best code,G+的回复里不乏一些大腕,最后是澳洲的一个
: college kid 贴的一行 code 被 Linux 采纳了,linux 的原贴如下:
: Linus TorvaldsMar 3, 2012 - Public
: More bitwise tricks..
: So my quest to calculate the hash and the length of a pathname component
: efficiently continues. I'm pretty happy with where I am now (some changes to
: the code have happened, it you actually want to see the current situation
: you need to check out the kernel mailing list post), but finding the number
: of bytes in the final mask bothers me.

v*****r
发帖数: 1119
11
I believe the following codes are what Linus added to kernel in the end (
Carl is the Aussie college kid).
/* Modified Carl Chatfield G+ version for 32-bit */
long a = (mask-256) >> 23;
long b = mask & 1;
return a + b + 1;
/* Jan Achrenius on G+ for 64-bit case */
return mask*0x0001020304050608 >> 56;

【在 S*A 的大作中提到】
: And the result code is...
:
: 个
: to
: number

c*****m
发帖数: 1160
12
damn, magic numbers. the worst thing in the coding world.
1 (共1页)
进入Linux版参与讨论
相关主题
Open Source 最大的贡献Linus 在 linux.com 发帖了。。。
Linus says...Linus Calls Microsoft Hatred "a Disease"
Linus became US citizen/.上面的评论笑死
这个kernel patch很值得期待阿Linux: Linux TTY维护者Alan Cox退出,称“我已经受够了” [ZZ]
读fork.c的时候发现一句脏话linus is a legend..
zan LinusLinux之父:Linux内核体积臃肿要瘦身
Linux基金会重新发布Linux网站According to Linus, Linux Is "Bloated"
Windows还能走多远 (更新)Linus给Windows 7树大拇指
相关话题的讨论汇总
话题: mask话题: linus话题: 骂娘话题: multiply话题: byte