From: Daniel Wagner <wagi-kQCPcA+X3s7YtjvyW6yDsg@public.gmane.org>
To: Eric Dumazet <eric.dumazet-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Cc: netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
cgroups-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
Daniel Wagner
<daniel.wagner-98C5kh4wR6ohFhg+JK9F0w@public.gmane.org>,
"David S. Miller" <davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>,
"Michael S. Tsirkin"
<mst-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>,
Eric Dumazet <edumazet-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>,
Glauber Costa <glommer-bzQdu9zFT3WakBO8gow8eQ@public.gmane.org>,
Joe Perches <joe-6d6DIl74uiNBDgjK7y7TUQ@public.gmane.org>,
Neil Horman <nhorman-2XuSBdqkA4R54TAoqtyWWQ@public.gmane.org>,
Stanislav Kinsbursky
<skinsbursky-bzQdu9zFT3WakBO8gow8eQ@public.gmane.org>,
Tejun Heo <tj-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
Subject: Re: [PATCH v0 3/4] cgroup: net_cls: Pass in task to sock_update_classid()
Date: Wed, 17 Oct 2012 17:54:40 +0200 [thread overview]
Message-ID: <507ED4C0.7070408@monom.org> (raw)
In-Reply-To: <1350481041.26103.454.camel@edumazet-glaptop>
On 17.10.2012 15:37, Eric Dumazet wrote:
> On Wed, 2012-10-17 at 15:04 +0200, Daniel Wagner wrote:
>> From: Daniel Wagner <daniel.wagner-98C5kh4wR6ohFhg+JK9F0w@public.gmane.org>
>>
>> sock_update_classid() assumes that the update operation always are
>> applied on the current task. sock_update_classid() needs to know on
>> which tasks to work on in order to be able to migrate task between
>> cgroups using the struct cgroup_subsys attach() callback.
>>
> ...
>
>>
>> -extern void sock_update_classid(struct sock *sk);
>> +extern void sock_update_classid(struct sock *sk, struct task_struct *task);
>>
>> #if IS_BUILTIN(CONFIG_NET_CLS_CGROUP)
>> static inline u32 task_cls_classid(struct task_struct *p)
>> diff --git a/net/core/sock.c b/net/core/sock.c
>> index 8a146cf..68c2f3b 100644
>> --- a/net/core/sock.c
>> +++ b/net/core/sock.c
>> @@ -1214,12 +1214,12 @@ static void sk_prot_free(struct proto *prot, struct sock *sk)
>>
>> #ifdef CONFIG_CGROUPS
>> #if IS_ENABLED(CONFIG_NET_CLS_CGROUP)
>> -void sock_update_classid(struct sock *sk)
>> +void sock_update_classid(struct sock *sk, struct task_struct *task)
>> {
>> u32 classid;
>>
>> rcu_read_lock(); /* doing current task, which cannot vanish. */
>> - classid = task_cls_classid(current);
>> + classid = task_cls_classid(task);
>> rcu_read_unlock();
>
>
> Comment is now misleading (since task might not be current) and
> rcu_read_lock()/rcu_read_unlock() protects nothing here, but avoid a
> lockdep splat...
>
> Hey task_cls_classid() has its own rcu protection since commit
> 3fb5a991916091a908d (cls_cgroup: Fix rcu lockdep warning)
>
> So we can safely revert Paul commit (1144182a8757f2a1)
> (We no longer need rcu_read_lock/unlock here)
Good point. Will update the series accordingly.
> (BTW net-next is not opened yet, its content outdated, although I like
> your patch series !)
I still have not figured all details on the patch submission procedure.
Sorry about that. The time to send patches for net-next will be annonced
by David, is this correct?
next prev parent reply other threads:[~2012-10-17 15:54 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-10-17 13:04 [PATCH v0 0/4] Rework net_cls update socket logic Daniel Wagner
[not found] ` <1350479078-29361-1-git-send-email-wagi-kQCPcA+X3s7YtjvyW6yDsg@public.gmane.org>
2012-10-17 13:04 ` [PATCH v0 1/4] cgroup: net_prio: Mark local used function static Daniel Wagner
2012-10-17 13:04 ` [PATCH v0 2/4] cgroup: net_cls: Fix local variable type decleration Daniel Wagner
2012-10-17 13:04 ` [PATCH v0 4/4] cgroup: net_cls: Rework update socket logic Daniel Wagner
[not found] ` <1350479078-29361-5-git-send-email-wagi-kQCPcA+X3s7YtjvyW6yDsg@public.gmane.org>
2012-10-17 14:02 ` John Fastabend
[not found] ` <507EBA59.9080307-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2012-10-17 15:56 ` Daniel Wagner
2012-10-17 13:04 ` [PATCH v0 3/4] cgroup: net_cls: Pass in task to sock_update_classid() Daniel Wagner
2012-10-17 13:37 ` Eric Dumazet
2012-10-17 15:54 ` Daniel Wagner [this message]
[not found] ` <507ED4C0.7070408-kQCPcA+X3s7YtjvyW6yDsg@public.gmane.org>
2012-10-17 16:15 ` Eric Dumazet
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=507ED4C0.7070408@monom.org \
--to=wagi-kqcpca+x3s7ytjvyw6ydsg@public.gmane.org \
--cc=cgroups-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=daniel.wagner-98C5kh4wR6ohFhg+JK9F0w@public.gmane.org \
--cc=davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org \
--cc=edumazet-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org \
--cc=eric.dumazet-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
--cc=glommer-bzQdu9zFT3WakBO8gow8eQ@public.gmane.org \
--cc=joe-6d6DIl74uiNBDgjK7y7TUQ@public.gmane.org \
--cc=mst-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
--cc=netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=nhorman-2XuSBdqkA4R54TAoqtyWWQ@public.gmane.org \
--cc=skinsbursky-bzQdu9zFT3WakBO8gow8eQ@public.gmane.org \
--cc=tj-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.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).