Received: by 2002:a25:ef43:0:0:0:0:0 with SMTP id w3csp621072ybm; Fri, 29 May 2020 08:13:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz8Dp8aNlper1AUGm5//g/igtSTUeH8BYIA204C46ubzbz1o4t4u+iQ7UQOMGd7jONDSaub X-Received: by 2002:a17:906:fac8:: with SMTP id lu8mr7878609ejb.432.1590765217072; Fri, 29 May 2020 08:13:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590765217; cv=none; d=google.com; s=arc-20160816; b=eFqIxODc2VCM/U/hSUdbXrKOZS2Ieu73PrJwQYExOYBujuw46AUtsSQ4x0CCfNJo2Q 7cV5jT3SAFsG3V+189TCyzvQob2Pth21wR/zfF6+OZGNYgVMFl6Kqa6kVQDtysxZ7W8n GfNj4hou50loxcladTHi6tCowchuNspHwMx5yCbSMTlI/m1HMUBExteZoS8pyi5iHb7J 9L3E/VqudHaelT60PooXht1eycwwqoRVhj8hjpPgI6i+g8yLDa2woUID+tkJfozBM5QZ SuGhNNbwAlOCvNe7ZNgJgxSABuQIvnN8Kv9fgK8uf76Q6OoW2PG4lyukHG/EsjB0/PP4 BDpQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:content-transfer-encoding :mime-version:references:in-reply-to:subject:cc:to:from; bh=D/1dZPUW5V+4QMH72iao93KJ6H84MZRpWQ8sS7tddTE=; b=TykGmhTUAo1Ln2myv82r+CHkZYIc97Jlt+el0aKcUVZf+9gtTVjt7yi/LNtv9VTbxo zqKGCziJN+FjZzlwB/io56k7LkB7HStBSXgTyizoGaQDZWrbQiy+A1zYYcAluEr8rukI TpvZCDtCv3JoaunWWo0HreKoAUBTff44Ke4Id2gPMpJZee+fkbDkj1UlB/lL1xpjicj/ SebywZKvK2DABkjMrMF/QRxYv/DKJhoywkB8bz6mvq4P1G40PN3VSg3ibB960iNwc9SM wtFQGTya8kBGclF7gf+5fxvFI9dkUNjl3KwWZXWc+inyhwz2wCVpCJT5Z2nwWr7s/KaG hUag== ARC-Authentication-Results: i=1; mx.google.com; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=vt.edu Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g1si5735377ejf.546.2020.05.29.08.13.12; Fri, 29 May 2020 08:13:37 -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; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=vt.edu Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726975AbgE2PLA (ORCPT + 99 others); Fri, 29 May 2020 11:11:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46924 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725901AbgE2PK7 (ORCPT ); Fri, 29 May 2020 11:10:59 -0400 Received: from omr1.cc.vt.edu (omr1.cc.ipv6.vt.edu [IPv6:2607:b400:92:8300:0:c6:2117:b0e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7CDDBC03E969 for ; Fri, 29 May 2020 08:10:59 -0700 (PDT) Received: from mr2.cc.vt.edu (mr2.cc.ipv6.vt.edu [IPv6:2607:b400:92:8400:0:90:e077:bf22]) by omr1.cc.vt.edu (8.14.4/8.14.4) with ESMTP id 04TFAwMr030856 for ; Fri, 29 May 2020 11:10:58 -0400 Received: from mail-qv1-f70.google.com (mail-qv1-f70.google.com [209.85.219.70]) by mr2.cc.vt.edu (8.14.7/8.14.7) with ESMTP id 04TFArar024307 for ; Fri, 29 May 2020 11:10:58 -0400 Received: by mail-qv1-f70.google.com with SMTP id l17so2563936qvv.10 for ; Fri, 29 May 2020 08:10:58 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:in-reply-to:references :mime-version:content-transfer-encoding:date:message-id; bh=D/1dZPUW5V+4QMH72iao93KJ6H84MZRpWQ8sS7tddTE=; b=KCQCLrmplhhA8bK8vsr0vcODpN2opbn3OS9InIjJs+/NT9Biy6LkHST/9H2qRmrm5L oiaXldyaANzJQoxYyYU53u1t6GW622nksXm7zj1Ad9+J5fWIDvoJWtyyapKyj9jOsVhS baBUATAyVOEWZcNgdjnJDzmXEyZfZQzDQz0j7CIOduJ0FA+1MSI3ZH4l1XAqRxzrOX+V 9DQhD56cA+qN1m0OE1/BamY0FIVNQW/dG+SKMPxiBzITZ7oZYtsEk2WAe1SrTXDt15zN CIcC17tKwMmQjhjgZHURiznqk//FMlYlPrXo+zrkGwrpFNLRBP17MGl7h7ypkD3of93q ot9Q== X-Gm-Message-State: AOAM5309bLwW2+IY42l+tXOXF0USYkZg1dUyJdYf4ZXiTGPkdxvd8qu5 TwwS80gywudFyG90lUjs5M2+l1vjrMzoZ2b8H3gBorV216DfyCTCc5ZBPKlUYR2ydgtBUIMqEr/ vZprwfb3BRFAE9f+19JK+KOFizY5ifn67gQI= X-Received: by 2002:a05:6214:9ce:: with SMTP id dp14mr7731827qvb.216.1590765047884; Fri, 29 May 2020 08:10:47 -0700 (PDT) X-Received: by 2002:a05:6214:9ce:: with SMTP id dp14mr7731788qvb.216.1590765047490; Fri, 29 May 2020 08:10:47 -0700 (PDT) Received: from turing-police ([2601:5c0:c001:c9e1::359]) by smtp.gmail.com with ESMTPSA id e1sm8019951qto.51.2020.05.29.08.10.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 May 2020 08:10:45 -0700 (PDT) From: "Valdis Kl=?utf-8?Q?=c4=93?=tnieks" X-Google-Original-From: "Valdis Kl=?utf-8?Q?=c4=93?=tnieks" X-Mailer: exmh version 2.9.0 11/07/2018 with nmh-1.7+dev To: Peter Zijlstra Cc: 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 In-Reply-To: <20200526161908.129371594@infradead.org> References: <20200526161057.531933155@infradead.org> <20200526161908.129371594@infradead.org> Mime-Version: 1.0 Content-Type: multipart/signed; boundary="==_Exmh_1590765044_16657P"; micalg=pgp-sha1; protocol="application/pgp-signature" Content-Transfer-Encoding: 7bit Date: Fri, 29 May 2020 11:10:44 -0400 Message-ID: <579691.1590765044@turing-police> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --==_Exmh_1590765044_16657P Content-Type: text/plain; charset=us-ascii On Tue, 26 May 2020 18:11:04 +0200, Peter Zijlstra said: > The recent commit: 90b5363acd47 ("sched: Clean up scheduler_ipi()") > got smp_call_function_single_async() subtly wrong. Even though it will > return -EBUSY when trying to re-use a csd, that condition is not > atomic and still requires external serialization. > kernel/smp.c | 47 ++++++++++++++++++++++++++++++++++++++++------- > --- a/kernel/smp.c > +++ b/kernel/smp.c > @@ -659,6 +685,13 @@ void __init smp_init(void) > BUILD_BUG_ON(offsetof(struct irq_work, flags) != > offsetof(struct __call_single_data, flags)); > > + /* > + * Assert the CSD_TYPE_TTWU layout is similar enough > + * for task_struct to be on the @call_single_queue. > + */ > + BUILD_BUG_ON(offsetof(struct task_struct, wake_entry_type) - offsetof(struct task_struct, wake_entry) != > + offsetof(struct __call_single_data, flags) - offsetof(struct __call_single_data, llist)); > + > idle_threads_init(); > cpuhp_threads_init(); This blows up on a 32-bit ARM allmodconfig: CC kernel/smp.o kernel/smp.c:319:6: warning: no previous prototype for 'flush_smp_call_function_from_idle' [-Wmissing-prototypes] void flush_smp_call_function_from_idle(void) ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In file included from ./arch/arm/include/asm/atomic.h:11, from ./include/linux/atomic.h:7, from ./include/linux/llist.h:51, from ./include/linux/irq_work.h:5, from kernel/smp.c:10: kernel/smp.c: In function 'smp_init': ./include/linux/compiler.h:392:38: error: call to '__compiletime_assert_152' declared with attribute error: BUILD_BUG_ON failed: offsetof(struct task_struct, wake_entry_type) - offsetof(struct task_struct, wake_entry) != offsetof(struct __call_single_data, flags) - offsetof(struct __call_single_data, llist) _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__) ^ ./include/linux/compiler.h:373:4: note: in definition of macro '__compiletime_assert' prefix ## suffix(); \ ^~~~~~ ./include/linux/compiler.h:392:2: note: in expansion of macro '_compiletime_assert' _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__) ^~~~~~~~~~~~~~~~~~~ ./include/linux/build_bug.h:39:37: note: in expansion of macro 'compiletime_assert' #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg) ^~~~~~~~~~~~~~~~~~ ./include/linux/build_bug.h:50:2: note: in expansion of macro 'BUILD_BUG_ON_MSG' BUILD_BUG_ON_MSG(condition, "BUILD_BUG_ON failed: " #condition) ^~~~~~~~~~~~~~~~ kernel/smp.c:689:2: note: in expansion of macro 'BUILD_BUG_ON' BUILD_BUG_ON(offsetof(struct task_struct, wake_entry_type) - offsetof(struct task_struct, wake_entry) != ^~~~~~~~~~~~ --==_Exmh_1590765044_16657P Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Comment: Exmh version 2.9.0 11/07/2018 iQIVAwUBXtEl9AdmEQWDXROgAQJk7g/9GzJmVBQbhYDA0N9BADiK5ZA49RVxRNYN yrcYB7uZ0BLjFkCJ/viYZqys7yG+VyTOAPH2DYJaizlx9wGvCj0eEmuJ3H8aBizo ZthJvyh/qaqGbJ4svQg+MOj61l858htgubtLm+0XfQ4mYVwOITwmoCKMjTJ9wcqo Y86Y9cEyxg87XcO7TS3i3CdxDCSERrh68wIcwjbR7Hie+QTsydxao40zw6kClH/9 c2v+cu/lDSxZdgg+V6OxtUrVX2KjYmGazc3Cbtg8ZgTaPdYnevfyHMmWsZCR7jfo NAO4zUKBLFUxnzHil/hQKbNSYXQVdGXDSl6XiQ940lV8WJI8ESowdjSqDj9oVWd6 0WX+VyKo+Y1SqY1NDvE2qKUWLj1WQ8E7FFjRv82/KIltWhYxvzTns9xX9eGwn94F mvHzq69j0tdLoyxshP67/3mJEmrwew86YIKDpvxHpT8yk3PXE/4ekkuPIf7YD7Ic O3uCRS/217nv1Zqv6wTPVyHj1ojCeJ3KsNVa3x3PpRG8gLaXj66Al5U7IN+vzIuL woSIK3Zb/JetA9MEMviim9+ld0dLgeC4i1NyStlZyk13R5tT8GlGSV7csIgJnXcC 08hs3kxVlij7FqOdR3LJgN1Md/brTzD4UMtWnHR7mQG5FUxuQqXFGxRcT74CT0Ns nXjdNFZ3Al0= =hd1G -----END PGP SIGNATURE----- --==_Exmh_1590765044_16657P--