Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp20246ybg; Tue, 9 Jun 2020 15:08:28 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzl8IdShT/3GPRRoqTs6tgPzoDfy0lZd/ZROzJiEa41nNerUDc+j/42GE3TxaaYirYYLeH/ X-Received: by 2002:a17:906:b88d:: with SMTP id hb13mr508590ejb.96.1591740508524; Tue, 09 Jun 2020 15:08:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591740508; cv=none; d=google.com; s=arc-20160816; b=QnFv8L7OHO5IwJ+MK1hF+0LDes3gt949U1yCD3noHO7s5b2EjLiilFopnAhcqUmYyO Hry+K82cEHGboO6HdmQnVfQ9LsTNATQVirjwQ3nGUxp3/VW+Q40sQIt2CGqztcpwdnNk NNzK8kOdTf2/SBz46NEvhORWdeeCqKTpMTbn/KEwOa6lqEL2SI2aTgNSB7XCt1K8zl+1 AYJEuxRnNn1cDTAX5NGm2X2Ug/X7VpZ2IdrlM3wCfvZVz1upsI9C114sY+sihvxsM3a2 biS2MmPCfxZ0QZwcLN4t3yCY0dvo4qzcYYtDRmjkt3QYSY95zauvPpuib6zOv3W1Olc/ teXQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=7/lG44ARFf8GNQeKBoTl0nMlFTL5GoW7edGGZcQSk8w=; b=fHYqbZQJqf8ecPUU1r9Jl9SecXfD3vvNXZmuRHVSjFaD2lmt57g4fqZ59tK00ciPK7 cnZUKngG4v+Z7Qhjqi+jZNO9SOHQuYaGrMROoZKA5OyhM+rmizO/ZBqfSw9UU9jE/d46 eJyAGwC3O/O+N6mwH/yWSI0vN+kuGTVS58NQUaAC0yCkAP2Up+Q29Lzd8Yp6Q8hfSykQ pQlvf+qdyiYTbAwDGwJNBxn1yKLqA20V4myrXWjfCrzSe5RsfBMLSMzm5Yb0zK3DQFb4 eWYqiR31m+lYhzP/7iVgXHrrxZO5P4EtxJy1pKOZf4HFa3L9ukjzREbnLZPqPmBF0Amv xuQw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=gbeeYQqh; 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 bs24si11465494edb.4.2020.06.09.15.08.06; Tue, 09 Jun 2020 15:08:28 -0700 (PDT) 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=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=gbeeYQqh; 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 S1728242AbgFIWGQ (ORCPT + 99 others); Tue, 9 Jun 2020 18:06:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52866 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726992AbgFIWGQ (ORCPT ); Tue, 9 Jun 2020 18:06:16 -0400 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 45ECBC05BD1E for ; Tue, 9 Jun 2020 15:06:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.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=7/lG44ARFf8GNQeKBoTl0nMlFTL5GoW7edGGZcQSk8w=; b=gbeeYQqhs01bJJA37dQ/DZIQ/Y d/cuFHSH34cU716BNtIfrY8UWBOCrqU8LqxO443u7OyeYsWrkx75EwmhlmkZE4H/BjfVG6l1Rsie/ LuiyUqgjPMTKizAt2G/aW3bCxGG4jIFOLbzUiQ27eucimK3tZt2ppcI7SQPjawafjRrhAB9GxfdDZ fuCu5mxX4BMX6Y3UZRwQRW6BSA61CCmn1H1APa7c+jnJPX7Ytbp0Lt312cCMgQrCbTR5A0qd5MTN4 WRiGCY8ZVMM7TbMzb8CutopYKYx59JH6gH/Xkbn6+7fApp7SECVzAb/pDONtySF94bMtY3TrJ/hcR DfBySkBQ==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=noisy.programming.kicks-ass.net) by bombadil.infradead.org with esmtpsa (Exim 4.92.3 #3 (Red Hat Linux)) id 1jimNg-0007sb-M7; Tue, 09 Jun 2020 22:06:04 +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 D98A73019CE; Wed, 10 Jun 2020 00:06:01 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id CBADE2038F8AB; Wed, 10 Jun 2020 00:06:01 +0200 (CEST) Date: Wed, 10 Jun 2020 00:06:01 +0200 From: Peter Zijlstra To: Eric Biggers Cc: Guenter Roeck , tglx@linutronix.de, frederic@kernel.org, linux-kernel@vger.kernel.org, x86@kernel.org, cai@lca.pw, mgorman@techsingularity.net Subject: Re: [RFC][PATCH 7/7] sched: Replace rq::wake_list Message-ID: <20200609220601.GD2514@hirez.programming.kicks-ass.net> References: <20200526161057.531933155@infradead.org> <20200526161908.129371594@infradead.org> <20200604141837.GA179816@roeck-us.net> <20200605002433.GA148196@sol.localdomain> <20200605074154.GB2750@hirez.programming.kicks-ass.net> <20200605161532.GD1373@sol.localdomain> <53318971-561c-b445-0408-530b3d3ba44e@roeck-us.net> <20200609202134.GA1105@sol.localdomain> <20200609212509.GA239889@roeck-us.net> <20200609213829.GA789@sol.localdomain> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200609213829.GA789@sol.localdomain> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jun 09, 2020 at 02:38:29PM -0700, Eric Biggers wrote: > Does the struct actually have to be named? How about: > > diff --git a/include/linux/sched.h b/include/linux/sched.h > index c5d96e3e7fff42..14ca25cda19150 100644 > --- a/include/linux/sched.h > +++ b/include/linux/sched.h > @@ -653,8 +653,14 @@ struct task_struct { > unsigned int ptrace; > > #ifdef CONFIG_SMP > - struct llist_node wake_entry; > - unsigned int wake_entry_type; > + /* > + * wake_entry_type must follow wake_entry, even when > + * CONFIG_GCC_PLUGIN_RANDSTRUCT=y. > + */ > + struct { > + struct llist_node wake_entry; > + unsigned int wake_entry_type; > + }; > int on_cpu; > #ifdef CONFIG_THREAD_INFO_IN_TASK > /* Current CPU: */ > > > However, it would be preferable to not rely on different structs sharing the > same field order, but rather write proper C code that uses the same struct > everywhere to encapsulate these 2 fields... https://lkml.kernel.org/r/20200605093704.GB2948@hirez.programming.kicks-ass.net And I have more patches on top to clean up some of the anonymous union stuff, that that's quite a lot of frobbing.