Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp1987336rdb; Thu, 7 Dec 2023 14:57:08 -0800 (PST) X-Google-Smtp-Source: AGHT+IEf4J9ff5HX3WU3OfCcUEvVK4P0QPvIQIKoyVwNi905wdbRiLTz1LJpTjXpt3CXZVW4BAK8 X-Received: by 2002:a17:902:efc4:b0:1d0:6ffd:adf7 with SMTP id ja4-20020a170902efc400b001d06ffdadf7mr3196369plb.94.1701989827599; Thu, 07 Dec 2023 14:57:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701989827; cv=none; d=google.com; s=arc-20160816; b=K4F9IymxdelTeKcNuRPYhs/sdGcy41+msTT8NGVbmNulfeSLL7znL7tnTvHC+oeGHd 1vtubjlk5fco3OTwbB3n2dQCZfhILSkx5Exj9WyRVcPpD2oiksUV5r/DbbOMyf+klE5m XlqtZ9qO4+FPQaiXRTjGwtaBTSVevXw7WyaZ8zt+G87uzvFgn2SyPW4C9bjkG9N2Dr4J XslAbibH227MOz57qYr7Uoh5mbpGLopHORCpy3GVIALDazhMbNRJz+KGtarfCX3Idvqu GU50/gS7O0RqrBrgDYeIGD9yz0qJIizmFZJglnAubrJZr1NfdAxbGV8lXyQVcbcY2lnU Yh5g== 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:sender:dkim-signature; bh=En3Kfr6yFcketU+H68sFxgGmFIYcncOOAldDpFCnChY=; fh=Nas0af87enX8HEW3HweYUkDTUjfLVeAgTs4y1YR4DDM=; b=e8wMZMvY9qlu6GLvJYwT8m4lJmRgDhu9OSZ1Cm6D6z4KEOfesfFPm04LIzmUjtWdwm A0BvBgEehOZRP8QFznH8S2hYkSrDz+/39l5O5Ront9AZVqC5L2Ovhh5YbwerKBRnJq0u NHusfWuIetpjv8tjeYmIBRGEh0rwZeq6EZbwt5J7YJVKwcT6PxFAyErcNjjiGEeBaV+o mO/ACSGnMvfIxUBbbJPmW4J3eq9V/LSub8Lhm9xJ9Wt+ckoFBKjYTNq1PvUxzZJObsvz RxSR4NExYDBSCJF8VUniQIEySwhshqnVhD6td1lrbP92qyIVDnrj7gUAIe8HYp2ttPv8 O26Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=QMeMDDbA; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id q14-20020a170902eb8e00b001cfb4caefa8si438400plg.644.2023.12.07.14.57.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Dec 2023 14:57:07 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) client-ip=23.128.96.33; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=QMeMDDbA; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id 1DAD480226A3; Thu, 7 Dec 2023 14:57:05 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232566AbjLGW4h (ORCPT + 99 others); Thu, 7 Dec 2023 17:56:37 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59098 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232495AbjLGW4f (ORCPT ); Thu, 7 Dec 2023 17:56:35 -0500 Received: from mail-pl1-x632.google.com (mail-pl1-x632.google.com [IPv6:2607:f8b0:4864:20::632]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D471ED5B; Thu, 7 Dec 2023 14:56:41 -0800 (PST) Received: by mail-pl1-x632.google.com with SMTP id d9443c01a7336-1d06819a9cbso11664505ad.1; Thu, 07 Dec 2023 14:56:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1701989801; x=1702594601; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:sender:from:to:cc:subject:date:message-id :reply-to; bh=En3Kfr6yFcketU+H68sFxgGmFIYcncOOAldDpFCnChY=; b=QMeMDDbAP88WWhVuuN5aeic6WA1UpuRXPiaU8foCuGOyzC4iupY6l/MEGyRmiQaWU3 TaSbuaWvuaAV1HwMrUXcc4aljpw9C5zcX4UnyF/Yic/GWAWsY62bIe/WllYBfFORn7jq Fj1VzcNojyOGBWMWaxAjTFEKrLcFV+BUrApCjrBPXnwAZaIqnZ8sG67Facwty4kMj/7R E3AAu26wxaVnRhP8lYEe/aC23l1X1B4T+anE8KeDcAbSbWw2FAl4VtNUig+55y8wcHnP MGFkZUycq4/QePBkUQ+KtQ344RWipaxY+ysU9U5lQgzfKAzqsrRL2Zvlbw6QGnU35nBF KDKw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701989801; x=1702594601; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:sender:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=En3Kfr6yFcketU+H68sFxgGmFIYcncOOAldDpFCnChY=; b=mcOAoWXC/pONZC96KfXkmJylfGBxZMTMbthMbZ/epp9jpdxrcrbSyI6rTQZaqMS5Te EN2P3RRlhFRncqow1ryFVEyVc7lmQklaphorsrBNuzZ4x/xpKArKSMBkWP6oh4Ceu2kG tD963lUQlU1D1TBYRJKKWw8Bnw6YjCRmXfT2Mf4eOyrdJr1lRqC/4X66bRhQ4ZX7CyMg zgT90iE4ICGypHHnGWFZacZGHi7LtAbLZ0pNHn0em+dyD8+MxCiRZqzSP2R07iC1v7Gy jRM0sJpcMw48ezXT5jUYuXWtxcUYrMHXVrKlzD8G4VZCFp8dOlZaHw/7+oVndOI2Iboo pgmA== X-Gm-Message-State: AOJu0YxDmw2KKUI8G0XkyHrL7b2oxIryYas12pob7X+Y0i1anUJUtVkS Zds1Juc9hTLLcs4+qrmMf1eTLA4LcGg= X-Received: by 2002:a17:902:be14:b0:1d0:6ffd:adf1 with SMTP id r20-20020a170902be1400b001d06ffdadf1mr2650460pls.88.1701989800194; Thu, 07 Dec 2023 14:56:40 -0800 (PST) Received: from localhost (dhcp-72-253-202-210.hawaiiantel.net. [72.253.202.210]) by smtp.gmail.com with ESMTPSA id t1-20020a170902b20100b001bb9d6b1baasm330392plr.198.2023.12.07.14.56.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Dec 2023 14:56:39 -0800 (PST) Sender: Tejun Heo Date: Thu, 7 Dec 2023 12:56:38 -1000 From: Tejun Heo To: Waiman Long Cc: Zefan Li , Johannes Weiner , Yafang Shao , cgroups@vger.kernel.org, linux-kernel@vger.kernel.org, Stephen Rothwell , Yosry Ahmed Subject: Re: [PATCH-cgroup v2] cgroup: Move rcu_head up near the top of cgroup_root Message-ID: References: <20231207134614.882991-1-longman@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231207134614.882991-1-longman@redhat.com> X-Spam-Status: No, score=-1.0 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Thu, 07 Dec 2023 14:57:05 -0800 (PST) On Thu, Dec 07, 2023 at 08:46:14AM -0500, Waiman Long wrote: > Commit d23b5c577715 ("cgroup: Make operations on the cgroup root_list RCU > safe") adds a new rcu_head to the cgroup_root structure and kvfree_rcu() > for freeing the cgroup_root. > > The current implementation of kvfree_rcu(), however, has the limitation > that the offset of the rcu_head structure within the larger data > structure must be less than 4096 or the compilation will fail. See the > macro definition of __is_kvfree_rcu_offset() in include/linux/rcupdate.h > for more information. > > By putting rcu_head below the large cgroup structure, any change to the > cgroup structure that makes it larger run the risk of causing build > failure under certain configurations. Commit 77070eeb8821 ("cgroup: > Avoid false cacheline sharing of read mostly rstat_cpu") happens to be > the last straw that breaks it. Fix this problem by moving the rcu_head > structure up before the cgroup structure. > > Fixes: d23b5c577715 ("cgroup: Make operations on the cgroup root_list RCU safe") > Reported-by: Stephen Rothwell > Closes: https://lore.kernel.org/lkml/20231207143806.114e0a74@canb.auug.org.au/ > Signed-off-by: Waiman Long > Acked-by: Yafang Shao Applied to cgroup/for-6.8. Thanks. -- tejun