Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935099AbbKTLEP (ORCPT ); Fri, 20 Nov 2015 06:04:15 -0500 Received: from mail.bmw-carit.de ([62.245.222.98]:38395 "EHLO mail.bmw-carit.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1759544AbbKTLEM (ORCPT ); Fri, 20 Nov 2015 06:04:12 -0500 X-CTCH-RefID: str=0001.0A0C0205.564EFE25.0249,ss=1,re=0.000,recu=0.000,reip=0.000,cl=1,cld=1,fgs=0 Subject: Re: [PATCH 6/7] sock, cgroup: add sock->sk_cgroup To: Tejun Heo , , , , , , References: <1447959171-20749-1-git-send-email-tj@kernel.org> <1447959171-20749-7-git-send-email-tj@kernel.org> CC: , , , , , , , From: Daniel Wagner Message-ID: <564EFE25.5000906@bmw-carit.de> Date: Fri, 20 Nov 2015 12:04:05 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: <1447959171-20749-7-git-send-email-tj@kernel.org> Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1036 Lines: 33 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@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/