Received: by 2002:a05:7412:a9a2:b0:e2:908c:2ebd with SMTP id o34csp1241601rdh; Fri, 27 Oct 2023 08:28:40 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEckNeq3Cv3KBo0tPm76RZQQDdTVPwZ7Bjk5vnJLz2fPAzTJNuiRQhSId0ras3vNlnRYqZW X-Received: by 2002:a05:620a:4089:b0:774:3436:aa22 with SMTP id f9-20020a05620a408900b007743436aa22mr2982100qko.5.1698420520571; Fri, 27 Oct 2023 08:28:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698420520; cv=none; d=google.com; s=arc-20160816; b=KNCGKeQA5lo8Joid+jtVnBWOhdNrs10xEUcV5HhquddiBRmk79kcUnPE1Tz1sEHHqO HlWrZbJ718fCmlHl74P+L75XKP4Co2yyuyuy9gAClE6luPQESaQu52St9PAeJi3ALXUy N+SAnovZVIMd9h1COa0Tk9C3rO37pEm6JTa21BHdYiRSEWWXhQx1Ctc6TEXXyCWa0oyF AGcMjfF/UoVpXLPWR4rmHDqtZY86pqAnYho0gHuSoNbt4jV6u4o31pUnGUOScpldpjzr drv+26ky6CzBvJuZIau+RhnPmzOvhm8HHu3Priw1bnJUkWVDzylKhN+rLyK0uTj9zr4+ JxwA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=pNsl5MInPLJ8RSTN609h9x1G8bOqBML3/WHWrkX2PGU=; fh=00Oux9zaM1b5Pf1vZ/6h7eQKGSEhzDT2M+8bcqgo53Y=; b=cw2dodLvEdJOkHKiF3ujlTaCz7KSVoX2YO5A7jUJ7b7sBt+qRsXPlHtscb8Y2aTjpe Sp6KPegwamRQR9wX3ueh8RWrHUyUqO32NSy4PqcuUAMhGsP0GT37Bworu0yxE8sIBgtX UeanlZOBuvcrEkS0ycQF/hHRjV00eRXBJA7+XU09gtMZhOx7e8CKguV2C9wQ/WKDTQ7+ +MPYXGPHhBxXLI3K+RIeWRABOJTk5eLOC+BBORqA0HZUlZ6u+aMu8cTfM519PMZYiuK9 Tzlt0HqzsLPVnfcU1vrLaBPMwHIY0rsDkUiqI2Wfcyx7jKW+RU00x4HAH0M3WZRyk73l FdBQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b="iRNlwOt/"; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id bl40-20020a05620a1aa800b00775d3ebaab5si798582qkb.286.2023.10.27.08.28.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 27 Oct 2023 08:28:40 -0700 (PDT) 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=@google.com header.s=20230601 header.b="iRNlwOt/"; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id 76CC680FD8AF; Fri, 27 Oct 2023 08:28:32 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346230AbjJ0P20 (ORCPT + 99 others); Fri, 27 Oct 2023 11:28:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53226 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231995AbjJ0P2Z (ORCPT ); Fri, 27 Oct 2023 11:28:25 -0400 Received: from mail-lj1-x234.google.com (mail-lj1-x234.google.com [IPv6:2a00:1450:4864:20::234]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 89DF618F for ; Fri, 27 Oct 2023 08:28:21 -0700 (PDT) Received: by mail-lj1-x234.google.com with SMTP id 38308e7fff4ca-2c50906f941so32940231fa.2 for ; Fri, 27 Oct 2023 08:28:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1698420500; x=1699025300; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=pNsl5MInPLJ8RSTN609h9x1G8bOqBML3/WHWrkX2PGU=; b=iRNlwOt/QoKpaCq6XxLrF0wXdv5Jy1DZzQLa+O9FPjAtqhZHpeAsOBBOnJUEpUoHkb jPBdwRVtq7uhfs1DnIMszqyK6ZuqHjlFPbYx6F8YhmKaa9d2zoGdydpWBd8gwTHkktic h+lkMhvRcnwrq1roygwA6d4kVZkWsM8uDzIi5CB1yiBEqlBb7pncDjXeH/gs9oCCyak3 oc9GtNzTYGaLv+TTk8G3rKDwbJe+oiQw+X5kMmqLa+J3gvhrUMxO+Auy7P8vDQNE8qIj WNSgZwSxNbvGOF2bWDisnIHP2Yg9nYLvMAfQ6SjzR8dfplstJXuPBV34aoocJw3/k/hj YKgw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698420500; x=1699025300; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=pNsl5MInPLJ8RSTN609h9x1G8bOqBML3/WHWrkX2PGU=; b=j0s4mluekjnkrp2fk4+hO5qnKzyI73149Xks7QENG5T/Yg9U577wXYATJmxEawyp7n 0IA9ZTJWIhvFcMreeOu9hBGMMbZCMr+L6DWDg9pU6fNwfoc1tdRSN8BhPyCrN1kix5ff BODCy+An+ONjRD4fgV6CDarh037ISuJ4DR6ImmaJQV2ZRBC6pW3USQ4//uph7F5XxqHn e813VeEHzm3eJxkIuFr0kivVjHQx6/xv2Lh24krSuh5POQ7t6Qux1PcNWkHcIEno1PS+ Ei96jBdVh5ebckQBantsMy41KMBsrmtYP9vIOL9shNKYCeuYyNc/LCerjA/nbA+qSHkx mzEQ== X-Gm-Message-State: AOJu0YxiLakDEnXcndwC4Pshl+241HhoM6ZsdAEDDKKV9WWazrypxOiI eyuI0WEhJe02aHVP5Q0g8S2zaPO7/RiV4bptxps10Q== X-Received: by 2002:a05:651c:1070:b0:2c5:47f:8ff7 with SMTP id y16-20020a05651c107000b002c5047f8ff7mr2161033ljm.18.1698420499387; Fri, 27 Oct 2023 08:28:19 -0700 (PDT) MIME-Version: 1.0 References: <20231024134637.3120277-1-surenb@google.com> <20231024134637.3120277-29-surenb@google.com> <87h6me620j.ffs@tglx> <87jzr93rxv.ffs@tglx> <20231026235433.yuvxf7opxg74ncmd@moria.home.lan> In-Reply-To: From: Nick Desaulniers Date: Fri, 27 Oct 2023 08:28:08 -0700 Message-ID: Subject: Re: [PATCH v2 28/39] timekeeping: Fix a circular include dependency To: Arnd Bergmann Cc: Kent Overstreet , Thomas Gleixner , Suren Baghdasaryan , Andrew Morton , Michal Hocko , Vlastimil Babka , Johannes Weiner , Roman Gushchin , Mel Gorman , Davidlohr Bueso , Matthew Wilcox , "Liam R. Howlett" , Jonathan Corbet , void@manifault.com, Peter Zijlstra , juri.lelli@redhat.com, ldufour@linux.ibm.com, Catalin Marinas , Will Deacon , Ingo Molnar , Dave Hansen , x86@kernel.org, peterx@redhat.com, David Hildenbrand , Jens Axboe , Luis Chamberlain , Masahiro Yamada , Nathan Chancellor , dennis@kernel.org, Tejun Heo , Muchun Song , Mike Rapoport , "Paul E. McKenney" , pasha.tatashin@soleen.com, yosryahmed@google.com, Yu Zhao , David Howells , Hugh Dickins , Andrey Konovalov , Kees Cook , vvvvvv@google.com, Greg Kroah-Hartman , Eric Biggers , ytcoode@gmail.com, Vincent Guittot , dietmar.eggemann@arm.com, Steven Rostedt , bsegall@google.com, bristot@redhat.com, vschneid@redhat.com, Christoph Lameter , Pekka Enberg , Joonsoo Kim , Hyeonggon Yoo <42.hyeyoo@gmail.com>, Alexander Potapenko , Marco Elver , Dmitry Vyukov , Shakeel Butt , Muchun Song , Jason Baron , David Rientjes , minchan@google.com, kaleshsingh@google.com, kernel-team@android.com, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, iommu@lists.linux.dev, Linux-Arch , linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-modules@vger.kernel.org, kasan-dev@googlegroups.com, cgroups@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-8.4 required=5.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_IN_DEF_DKIM_WL 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]); Fri, 27 Oct 2023 08:28:32 -0700 (PDT) On Thu, Oct 26, 2023 at 11:35=E2=80=AFPM Arnd Bergmann wrot= e: > > On Fri, Oct 27, 2023, at 01:54, Kent Overstreet wrote: > > On Fri, Oct 27, 2023 at 01:05:48AM +0200, Thomas Gleixner wrote: > >> On Thu, Oct 26 2023 at 18:33, Suren Baghdasaryan wrote: > >> > On Wed, Oct 25, 2023 at 5:33=E2=80=AFPM Thomas Gleixner wrote: > >> >> > This avoids a circular header dependency in an upcoming patch by = only > >> >> > making hrtimer.h depend on percpu-defs.h > >> >> > >> >> What's the actual dependency problem? > >> > > >> > Sorry for the delay. > >> > When we instrument per-cpu allocations in [1] we need to include > >> > sched.h in percpu.h to be able to use alloc_tag_save(). sched.h > >> > >> Including sched.h in percpu.h is fundamentally wrong as sched.h is the > >> initial place of all header recursions. > >> > >> There is a reason why a lot of funtionalitiy has been split out of > >> sched.h into seperate headers over time in order to avoid that. > > > > Yeah, it's definitely unfortunate. The issue here is that > > alloc_tag_save() needs task_struct - we have to pull that in for > > alloc_tag_save() to be inline, which we really want. > > > > What if we moved task_struct to its own dedicated header? That might be > > good to do anyways... > > Yes, I agree that is the best way to handle it. I've prototyped > a more thorough header cleanup with good results (much improved > build speed) in the past, and most of the work to get there is > to seperate out structures like task_struct, mm_struct, net_device, > etc into headers that only depend on the embedded structure > definitions without needing all the inline functions associated > with them. This is something I'll add to our automation todos which I plan to talk about at plumbers; I feel like it should be possible to write a script that given a header and identifier can split whatever declaration out into a new header, update the old header, then add the necessary includes for the newly created header to each dependent (optional). --=20 Thanks, ~Nick Desaulniers