* [PATCH net-next] af_unix: optimize unix_writable by inlining
@ 2015-11-02 17:01 Aaron Conole
2015-11-02 17:08 ` David Miller
2015-11-02 17:13 ` Eric Dumazet
0 siblings, 2 replies; 4+ messages in thread
From: Aaron Conole @ 2015-11-02 17:01 UTC (permalink / raw)
To: netdev; +Cc: Aaron Conole
unix_writable() originally was inlined, but was changed as part of
commit 1586a5877db9 ("af_unix: do not report POLLOUT on
listeners"). Re-enable the inline flag.
Signed-off-by: Aaron Conole <aconole@bytheb.org>
Cc: Eric Dumazet <edumazet@google.com>
---
net/unix/af_unix.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/unix/af_unix.c b/net/unix/af_unix.c
index aaa0b58..f0c7f0c 100644
--- a/net/unix/af_unix.c
+++ b/net/unix/af_unix.c
@@ -326,7 +326,7 @@ found:
return s;
}
-static int unix_writable(const struct sock *sk)
+static inline int unix_writable(const struct sock *sk)
{
return sk->sk_state != TCP_LISTEN &&
(atomic_read(&sk->sk_wmem_alloc) << 2) <= sk->sk_sndbuf;
--
2.6.1.133.gf5b6079
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH net-next] af_unix: optimize unix_writable by inlining
2015-11-02 17:01 [PATCH net-next] af_unix: optimize unix_writable by inlining Aaron Conole
@ 2015-11-02 17:08 ` David Miller
2015-11-02 17:55 ` Aaron Conole
2015-11-02 17:13 ` Eric Dumazet
1 sibling, 1 reply; 4+ messages in thread
From: David Miller @ 2015-11-02 17:08 UTC (permalink / raw)
To: aconole; +Cc: netdev
From: Aaron Conole <aconole@bytheb.org>
Date: Mon, 2 Nov 2015 12:01:59 -0500
> unix_writable() originally was inlined, but was changed as part of
> commit 1586a5877db9 ("af_unix: do not report POLLOUT on
> listeners"). Re-enable the inline flag.
>
> Signed-off-by: Aaron Conole <aconole@bytheb.org>
This is never appropriate.
The compiler should be fixed to inline functions properly when
appropriate for the optimization level requested.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH net-next] af_unix: optimize unix_writable by inlining
2015-11-02 17:01 [PATCH net-next] af_unix: optimize unix_writable by inlining Aaron Conole
2015-11-02 17:08 ` David Miller
@ 2015-11-02 17:13 ` Eric Dumazet
1 sibling, 0 replies; 4+ messages in thread
From: Eric Dumazet @ 2015-11-02 17:13 UTC (permalink / raw)
To: Aaron Conole; +Cc: netdev
On Mon, 2015-11-02 at 12:01 -0500, Aaron Conole wrote:
> unix_writable() originally was inlined, but was changed as part of
> commit 1586a5877db9 ("af_unix: do not report POLLOUT on
> listeners"). Re-enable the inline flag.
>
> Signed-off-by: Aaron Conole <aconole@bytheb.org>
> Cc: Eric Dumazet <edumazet@google.com>
> ---
We leave this to the compiler nowadays.
If you take a look at disassembly, you'll see your patch has no effect
at all.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH net-next] af_unix: optimize unix_writable by inlining
2015-11-02 17:08 ` David Miller
@ 2015-11-02 17:55 ` Aaron Conole
0 siblings, 0 replies; 4+ messages in thread
From: Aaron Conole @ 2015-11-02 17:55 UTC (permalink / raw)
To: David Miller; +Cc: netdev
David Miller <davem@davemloft.net> writes:
> From: Aaron Conole <aconole@bytheb.org>
> Date: Mon, 2 Nov 2015 12:01:59 -0500
>
>> unix_writable() originally was inlined, but was changed as part of
>> commit 1586a5877db9 ("af_unix: do not report POLLOUT on
>> listeners"). Re-enable the inline flag.
>>
>> Signed-off-by: Aaron Conole <aconole@bytheb.org>
>
> This is never appropriate.
>
> The compiler should be fixed to inline functions properly when
> appropriate for the optimization level requested.
Okay, apologies for the noise.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2015-11-02 17:55 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-11-02 17:01 [PATCH net-next] af_unix: optimize unix_writable by inlining Aaron Conole
2015-11-02 17:08 ` David Miller
2015-11-02 17:55 ` Aaron Conole
2015-11-02 17:13 ` Eric Dumazet
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).