netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Daniel Wagner <wagi@monom.org>
To: cgroups@vger.kernel.org
Cc: netdev@vger.kernel.org,
	Daniel Wagner <daniel.wagner@bmw-carit.de>,
	Kamezawa Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>,
	Glauber Costa <glommer@parallels.com>, Tejun Heo <tj@kernel.org>,
	Li Zefan <lizefan@huawei.com>, Eric Dumazet <edumazet@google.com>,
	"David S. Miller" <davem@davemloft.net>
Subject: [PATCH v2 1/5] cgroup: Only update sk_cgrp_prioidx on change
Date: Wed, 11 Jul 2012 11:35:37 +0200	[thread overview]
Message-ID: <1341999341-1808-2-git-send-email-wagi@monom.org> (raw)
In-Reply-To: <1341999341-1808-1-git-send-email-wagi@monom.org>

From: Daniel Wagner <daniel.wagner@bmw-carit.de>

Do not make the cache line dirty when nothing has changed.
sock_update_classid() does exactly the same thing.

Signed-off-by: Daniel Wagner <daniel.wagner@bmw-carit.de>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
Cc: Kamezawa Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Cc: Glauber Costa <glommer@parallels.com>
Cc: Tejun Heo <tj@kernel.org>
Cc: Li Zefan <lizefan@huawei.com>
Cc: Eric Dumazet <edumazet@google.com>
Cc: "David S. Miller" <davem@davemloft.net>
---
 net/core/sock.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/net/core/sock.c b/net/core/sock.c
index 929bdcc..bbab10d 100644
--- a/net/core/sock.c
+++ b/net/core/sock.c
@@ -1182,10 +1182,14 @@ EXPORT_SYMBOL(sock_update_classid);
 
 void sock_update_netprioidx(struct sock *sk)
 {
+	u32 prioidx;
+
 	if (in_interrupt())
 		return;
 
-	sk->sk_cgrp_prioidx = task_netprioidx(current);
+	prioidx = task_netprioidx(current);
+	if (prioidx != sk->sk_cgrp_prioidx)
+		sk->sk_cgrp_prioidx = prioidx;
 }
 EXPORT_SYMBOL_GPL(sock_update_netprioidx);
 #endif
-- 
1.7.11.1.165.g299666c

  reply	other threads:[~2012-07-11  9:35 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-11  9:35 [PATCH v2 0/5] cgroup cls & netprio 'cleanups' Daniel Wagner
2012-07-11  9:35 ` Daniel Wagner [this message]
2012-07-11  9:35 ` [PATCH v2 3/5] cgroup: Do not add sock_update_netprioidx() when CONFIG_NETPRIO_CGROUP=0 Daniel Wagner
2012-07-11  9:35 ` [PATCH v2 4/5] cgroup: Make builtin vs. module build ifdefs consistent Daniel Wagner
     [not found] ` <1341999341-1808-1-git-send-email-wagi-kQCPcA+X3s7YtjvyW6yDsg@public.gmane.org>
2012-07-11  9:35   ` [PATCH v2 2/5] cgroup: Do not add sock_update_classid() when CONFIG_NET_CLS_CGROUP=0 Daniel Wagner
2012-07-11  9:35   ` [PATCH v2 5/5] cgroup: Make builtin vs. module build ifdefs consistent Daniel Wagner
2012-07-13 13:53   ` [PATCH v2 0/5] cgroup cls & netprio 'cleanups' Daniel Wagner
2012-07-13 15:04     ` David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1341999341-1808-2-git-send-email-wagi@monom.org \
    --to=wagi@monom.org \
    --cc=cgroups@vger.kernel.org \
    --cc=daniel.wagner@bmw-carit.de \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=glommer@parallels.com \
    --cc=kamezawa.hiroyu@jp.fujitsu.com \
    --cc=lizefan@huawei.com \
    --cc=netdev@vger.kernel.org \
    --cc=tj@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).