[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <564EFE25.5000906@bmw-carit.de>
Date: Fri, 20 Nov 2015 12:04:05 +0100
From: Daniel Wagner <daniel.wagner@...-carit.de>
To: Tejun Heo <tj@...nel.org>, <davem@...emloft.net>,
<pablo@...filter.org>, <kaber@...sh.net>,
<kadlec@...ckhole.kfki.hu>, <lizefan@...wei.com>,
<hannes@...xchg.org>
CC: <netdev@...r.kernel.org>, <netfilter-devel@...r.kernel.org>,
<coreteam@...filter.org>, <cgroups@...r.kernel.org>,
<linux-kernel@...r.kernel.org>, <kernel-team@...com>,
<daniel@...earbox.net>, <nhorman@...driver.com>
Subject: Re: [PATCH 6/7] sock, cgroup: add sock->sk_cgroup
Hi Tejun,
On 11/19/2015 07:52 PM, Tejun Heo wrote:
> +/*
> + * There's a theoretical window where the following accessors race with
> + * updaters and return part of the previous pointer as the prioidx or
> + * classid. Such races are short-lived and the result isn't critical.
> + */
> static inline u16 sock_cgroup_prioidx(struct sock_cgroup_data *skcd)
> {
> - return skcd->prioidx;
> + return (skcd->is_data & 1) ? skcd->prioidx : 1;
> }
>
> static inline u32 sock_cgroup_classid(struct sock_cgroup_data *skcd)
> {
> - return skcd->classid;
> + return (skcd->is_data & 1) ? skcd->classid : 0;
> }
I still try to understand what the code does, hence this stupid question:
Why is sock_cgroup_prioidx() returning 1 if is not data and
sock_cgroup_classid() a 0?
thanks,
daniel
--
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