From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D2B13C64E7A for ; Tue, 1 Dec 2020 19:21:18 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 6F7F52151B for ; Tue, 1 Dec 2020 19:21:18 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=joelfernandes.org header.i=@joelfernandes.org header.b="bfmc4F3b" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2392245AbgLATVL (ORCPT ); Tue, 1 Dec 2020 14:21:11 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34986 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725933AbgLATVL (ORCPT ); Tue, 1 Dec 2020 14:21:11 -0500 Received: from mail-qk1-x735.google.com (mail-qk1-x735.google.com [IPv6:2607:f8b0:4864:20::735]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DD0A9C0613D6 for ; Tue, 1 Dec 2020 11:20:30 -0800 (PST) Received: by mail-qk1-x735.google.com with SMTP id y197so2432289qkb.7 for ; Tue, 01 Dec 2020 11:20:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=joelfernandes.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=gvcwZazLD0aWAKt5JLN1s2XKk3UfdMLUwfX82KGCpdc=; b=bfmc4F3bJBRxByvRMIl9gd+rkjs6TtDwUM18GWNj438gxnj+hCHQ+kMwFsOAaXX4vG 2k0D81n3Wmr77oEQ7hEul3u2CB0fk5ojNhqSXKdDltBWLxtuDjhdQbjE6JTcYJ2colwr b22aqiGhYZxUz6sCIax5poabt31HGpGLAh0Aw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=gvcwZazLD0aWAKt5JLN1s2XKk3UfdMLUwfX82KGCpdc=; b=oOwFsBcKRPUCYOpaBCTP4PMWW5EpRbgYghkvCmtQ8d2OWSKX4ajM+25niaPAiaR+Co MMQoq99BqnQC3vFbKYdXw5Aw8qb+1L5yFI6f4XrBqKqIJA60K9HgjlOqU0tHTF93kKnh 4MX2vbAxldJAegbOrh7GU/D1UQF9NTVOl2hdIGEW6lb5KBmY1Juj++hRxCn1YKxt2oRa Kg/TxC5q2NwYbteEHiNdh/UWrxxdgGyvsW5WbZtY42J0P+uZ3op5KkZFb4kfFjAbM1vf EYO0D5MHXI9CMiqfIGhV60oXL7QMldXsGLaVv51XEGs8IkB4HRRpMTh8RLU6ajw5W8xc 88aQ== X-Gm-Message-State: AOAM531zJnEevZiCqkuvPzON+viNbV0hzwzZxbGjpdAgGx9uDg4Iy3ij 3IWMREE4KwN58wlPvR5BEmdKaA== X-Google-Smtp-Source: ABdhPJzwbOe8E+Uznc9xPQrSMQbb4FFttEb5t0m2JjTri9dELFAbozAPQBOAFaSknCrL/tuhEpiejw== X-Received: by 2002:a05:620a:7c9:: with SMTP id 9mr4523205qkb.329.1606850430139; Tue, 01 Dec 2020 11:20:30 -0800 (PST) Received: from localhost ([2620:15c:6:411:cad3:ffff:feb3:bd59]) by smtp.gmail.com with ESMTPSA id 72sm624596qkn.44.2020.12.01.11.20.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Dec 2020 11:20:29 -0800 (PST) Date: Tue, 1 Dec 2020 14:20:28 -0500 From: Joel Fernandes To: Peter Zijlstra 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: <20201201192028.GA222419@google.com> References: <20201117232003.3580179-1-joel@joelfernandes.org> <20201117232003.3580179-23-joel@joelfernandes.org> <20201125111014.GS2414@hirez.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201125111014.GS2414@hirez.programming.kicks-ass.net> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Nov 25, 2020 at 12:10:14PM +0100, Peter Zijlstra wrote: > 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. This is fixed in a later patch by Josh "sched: Refactor core cookie into struct" where we are having independent fields for each type of cookie. I'll squash it next time I post to prevent confusion. Thanks, - Joel