[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1319770376.23112.58.camel@edumazet-laptop>
Date: Fri, 28 Oct 2011 04:52:56 +0200
From: Eric Dumazet <eric.dumazet@...il.com>
To: Ben Hutchings <bhutchings@...arflare.com>
Cc: Linus Torvalds <torvalds@...ux-foundation.org>,
Andi Kleen <andi@...stfloor.org>,
linux-kernel <linux-kernel@...r.kernel.org>,
netdev <netdev@...r.kernel.org>,
Andrew Morton <akpm@...ux-foundation.org>
Subject: Re: [RFC] should VM_BUG_ON(cond) really evaluate cond
Le vendredi 28 octobre 2011 à 02:44 +0100, Ben Hutchings a écrit :
> Whether or not it needs to provide any ordering guarantee, atomic_read()
> must never read more than once, and I think that requires the volatile
> qualification. It might be clearer to use the ACCESS_ONCE macro,
> however.
>
Where this requirement comes from ?
Maybe then introduce atomic_read_once() for users really needing it :)
ACCESS_ONCE will force the read/move instruction I try to avoid :(
By the way, removing volatile on my x86_64 defconfig saves a bit of
space :
# size vmlinux vmlinux.old
text data bss dec hex filename
10907585 2890992 1540096 15338673 ea0cb1 vmlinux
10912342 2891056 1540096 15343494 ea1f86 vmlinux.old
booted and everything seems fine, but obviously lightly tested...
Note : There is still one useless access to page-flags,
'fixing' atomic_read() is not enough.
0,04 : ffffffff815e4675: je ffffffff815e4870 <tcp_sendmsg+0xc80>
0,08 : ffffffff815e467b: mov (%r9),%rax // useless
2,08 : ffffffff815e467e: lock incl 0x1c(%r9)
3,58 : ffffffff815e4683: mov (%r9),%rax
0,04 : ffffffff815e4686: test $0x80,%ah
0,00 : ffffffff815e4689: jne ffffffff815e48ee <tcp_sendmsg+0xcfe>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists