Re: [PATCH 05/14] net: tcp_memcontrol: protect all tcp_memcontrol calls by jump-label
On Sat, Nov 14, 2015 at 07:33:10PM +0300, Vladimir Davydov wrote: > On Thu, Nov 12, 2015 at 06:41:24PM -0500, Johannes Weiner wrote: > > Move the jump-label from sock_update_memcg() and sock_release_memcg() > > to the callsite, and so eliminate those function calls when socket > > accounting is not enabled. > > I don't believe this patch's necessary, because these functions aren't > hot paths. Neither do I think it makes the code look better. Anyway, > it's rather a matter of personal preference, and the patch looks correct > to me, so Yeah, it's not a hotpath. What I like primarily about this patch I guess is that makes it more consistent how memcg entry is gated. You don't have to remember which functions have the checks in the caller and which have it in the function themselves. And I really hate the static inline void foo(void) { if (foo_enabled()) __foo() } in the headerfile pattern. > Reviewed-by: Vladimir Davydov Thanks, I appreciate you acking it despite your personal preference! -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH 05/14] net: tcp_memcontrol: protect all tcp_memcontrol calls by jump-label
On Sat, Nov 14, 2015 at 07:33:10PM +0300, Vladimir Davydov wrote: > On Thu, Nov 12, 2015 at 06:41:24PM -0500, Johannes Weiner wrote: > > Move the jump-label from sock_update_memcg() and sock_release_memcg() > > to the callsite, and so eliminate those function calls when socket > > accounting is not enabled. > > I don't believe this patch's necessary, because these functions aren't > hot paths. Neither do I think it makes the code look better. Anyway, > it's rather a matter of personal preference, and the patch looks correct > to me, so Yeah, it's not a hotpath. What I like primarily about this patch I guess is that makes it more consistent how memcg entry is gated. You don't have to remember which functions have the checks in the caller and which have it in the function themselves. And I really hate the static inline void foo(void) { if (foo_enabled()) __foo() } in the headerfile pattern. > Reviewed-by: Vladimir DavydovThanks, I appreciate you acking it despite your personal preference! -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH 05/14] net: tcp_memcontrol: protect all tcp_memcontrol calls by jump-label
On Thu, Nov 12, 2015 at 06:41:24PM -0500, Johannes Weiner wrote: > Move the jump-label from sock_update_memcg() and sock_release_memcg() > to the callsite, and so eliminate those function calls when socket > accounting is not enabled. I don't believe this patch's necessary, because these functions aren't hot paths. Neither do I think it makes the code look better. Anyway, it's rather a matter of personal preference, and the patch looks correct to me, so Reviewed-by: Vladimir Davydov > > This also eliminates the need for dummy functions because the calls > will be optimized away if the Kconfig options are not enabled. > > Signed-off-by: Johannes Weiner -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH 05/14] net: tcp_memcontrol: protect all tcp_memcontrol calls by jump-label
On Thu, Nov 12, 2015 at 06:41:24PM -0500, Johannes Weiner wrote: > Move the jump-label from sock_update_memcg() and sock_release_memcg() > to the callsite, and so eliminate those function calls when socket > accounting is not enabled. I don't believe this patch's necessary, because these functions aren't hot paths. Neither do I think it makes the code look better. Anyway, it's rather a matter of personal preference, and the patch looks correct to me, so Reviewed-by: Vladimir Davydov> > This also eliminates the need for dummy functions because the calls > will be optimized away if the Kconfig options are not enabled. > > Signed-off-by: Johannes Weiner -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH 05/14] net: tcp_memcontrol: protect all tcp_memcontrol calls by jump-label
From: Johannes Weiner Date: Thu, 12 Nov 2015 18:41:24 -0500 > Move the jump-label from sock_update_memcg() and sock_release_memcg() > to the callsite, and so eliminate those function calls when socket > accounting is not enabled. > > This also eliminates the need for dummy functions because the calls > will be optimized away if the Kconfig options are not enabled. > > Signed-off-by: Johannes Weiner Acked-by: David S. Miller -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH 05/14] net: tcp_memcontrol: protect all tcp_memcontrol calls by jump-label
From: Johannes WeinerDate: Thu, 12 Nov 2015 18:41:24 -0500 > Move the jump-label from sock_update_memcg() and sock_release_memcg() > to the callsite, and so eliminate those function calls when socket > accounting is not enabled. > > This also eliminates the need for dummy functions because the calls > will be optimized away if the Kconfig options are not enabled. > > Signed-off-by: Johannes Weiner Acked-by: David S. Miller -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/