Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp286785pxu; Wed, 25 Nov 2020 03:13:28 -0800 (PST) X-Google-Smtp-Source: ABdhPJzpuf7cIfff6uFg2bzC2yzu3R6hDKWtQQOXpqfgX/LQJEQjNExVOGLCrEOg3uqRzvinuyOL X-Received: by 2002:aa7:d54b:: with SMTP id u11mr3036881edr.341.1606302807793; Wed, 25 Nov 2020 03:13:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606302807; cv=none; d=google.com; s=arc-20160816; b=QJjzLjFqXWAW2bWttIInuE4//voHPuZPDWkR3WqsqK+foGNmInhDyQzB4WV0zYu7GK wzlHeBc7OqzZc9AGzDltg7FiY8p0oXk8VERfJLo+OD3hC30Skn8bNnYwXARvhn56bGFp 3qGQeUyOMmMleFXqfZ27nyzo/R/t5CxbwyOz5EYOdAhVZQ9104Zt7GFMsm6lcqUay7rX /oOrPGMku7BN8PJScqWT3mlVRLadBz2HAV6rFT44Nu+zvOUSPRFJ8ow1ng3DNVdAWggB yhJqgzenNDQt+dJAASOmbqvpx048ChL1zLpKBMdJithzkP8R5zT6HJY5CyNl1bMZFaht CcPg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=reKT6LG6AzTdzZ7PfWjq8eopMMV3Z6WkzXizdIvYzFk=; b=JPfHnkICYwpgUU+0gegEhKh1vW6xg+l+XFll/0vSaia8j+sGFc4+WruTzcY3zBjuOs jPGXlgb5msDVrP3x6Uug2+v1lEwKpG7DM/N8ZtOquKiwpOZw/Ns2pKPHQNRTFs2zNYZU xKf1QH3PPXAJRMI0ZezvcwtytxZW0lR6yN0glkBS6U3r9gTAZG9J1QbABRBHjA3fViMa Xnc4o5UfJvyXm3SpSVIjAjDX1AzOQdfAKoRTsdVUDByc7BuLjADw7TqV16S6UsJn4UUG pCJa79zhGaPdiY5U/kEtz2rgsCRgGt2U46SYQp669OyCanUKjrUBDRDBZiUO57RGaeMA syxA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=merlin.20170209 header.b=AJES3mm5; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i12si1029524edr.244.2020.11.25.03.13.05; Wed, 25 Nov 2020 03:13:27 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=merlin.20170209 header.b=AJES3mm5; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728472AbgKYLL3 (ORCPT + 99 others); Wed, 25 Nov 2020 06:11:29 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37350 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727827AbgKYLL3 (ORCPT ); Wed, 25 Nov 2020 06:11:29 -0500 Received: from merlin.infradead.org (merlin.infradead.org [IPv6:2001:8b0:10b:1231::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 046EBC0613D4 for ; Wed, 25 Nov 2020 03:11:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=reKT6LG6AzTdzZ7PfWjq8eopMMV3Z6WkzXizdIvYzFk=; b=AJES3mm5nzzN9XS8gbjYNbrohe TNZKZtE3pgXCFSHA1ggdaccpY5IiGho20mYH8aUiMHrkox2ocVo9dRM2WaE7byR2+clSvOGQd87e7 UgaK7NuU5WLdmsngn/sZ4+SaN3n5NIbmG6wax+eyEy/hZ45/kULjqlUnXFMMntkDeyXnovcp4NfF6 5oAL01C+lI0p1K6TZS4QNAWRDiurQ+wVdk13FuG6aPpypMiHgmvKXdwXoSWVBFZrtTfnOXtRm3n6s 4fibQSYl/WjIQJLG7jJ2+PeDCVisikfHPHfTbnx8AgEmbMpl8BPXoRwhTip8IGPDrJuljVD7yr34a kciujeYw==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=noisy.programming.kicks-ass.net) by merlin.infradead.org with esmtpsa (Exim 4.92.3 #3 (Red Hat Linux)) id 1khsgi-00079r-N7; Wed, 25 Nov 2020 11:10:16 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id 8E36730280E; Wed, 25 Nov 2020 12:10:14 +0100 (CET) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 786B4200B84B2; Wed, 25 Nov 2020 12:10:14 +0100 (CET) Date: Wed, 25 Nov 2020 12:10:14 +0100 From: Peter Zijlstra To: "Joel Fernandes (Google)" Cc: Nishanth Aravamudan , Julien Desfossez , Tim Chen , Vineeth Pillai , Aaron Lu , Aubrey Li , tglx@linutronix.de, linux-kernel@vger.kernel.org, mingo@kernel.org, torvalds@linux-foundation.org, fweisbec@gmail.com, keescook@chromium.org, kerrnel@google.com, Phil Auld , Valentin Schneider , Mel Gorman , Pawan Gupta , Paolo Bonzini , vineeth@bitbyteword.org, Chen Yu , Christian Brauner , Agata Gruza , Antonio Gomez Iglesias , graf@amazon.com, konrad.wilk@oracle.com, dfaggioli@suse.com, pjt@google.com, rostedt@goodmis.org, derkling@google.com, benbjiang@tencent.com, Alexandre Chartre , James.Bottomley@hansenpartnership.com, OWeisse@umich.edu, Dhaval Giani , Junaid Shahid , jsbarnes@google.com, chris.hyser@oracle.com, Ben Segall , Josh Don , Hao Luo , Tom Lendacky , Aubrey Li , "Paul E. McKenney" , Tim Chen Subject: Re: [PATCH -tip 22/32] sched: Split the cookie and setup per-task cookie on fork Message-ID: <20201125111014.GS2414@hirez.programming.kicks-ass.net> References: <20201117232003.3580179-1-joel@joelfernandes.org> <20201117232003.3580179-23-joel@joelfernandes.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201117232003.3580179-23-joel@joelfernandes.org> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Nov 17, 2020 at 06:19:52PM -0500, Joel Fernandes (Google) wrote: > +void sched_core_tag_requeue(struct task_struct *p, unsigned long cookie, bool group) > +{ > + if (!p) > + return; > + > + if (group) > + p->core_group_cookie = cookie; > + else > + p->core_task_cookie = cookie; > + > + /* Use up half of the cookie's bits for task cookie and remaining for group cookie. */ > + p->core_cookie = (p->core_task_cookie << > + (sizeof(unsigned long) * 4)) + p->core_group_cookie; This seems dangerous; afaict there is nothing that prevents cookie collision.