From nobody Thu Nov 18 05:32:47 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4329718A5D53; Thu, 18 Nov 2021 05:32:59 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HvpNW0zszz4sy8; Thu, 18 Nov 2021 05:32:59 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from mail-qt1-f171.google.com (mail-qt1-f171.google.com [209.85.160.171]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "GTS CA 1D4" (verified OK)) (Authenticated sender: kevans) by smtp.freebsd.org (Postfix) with ESMTPSA id 012F7242CA; Thu, 18 Nov 2021 05:32:59 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: by mail-qt1-f171.google.com with SMTP id m25so4960509qtq.13; Wed, 17 Nov 2021 21:32:58 -0800 (PST) X-Gm-Message-State: AOAM531g3zfo8Ivs6guDz4+LoX5CXlFq19OzeK+R8vIuKEjvbkpWF0JL Vdo3P9SRRWxtuhNTQMmMfQg6iygwdrT1E527jTw= X-Google-Smtp-Source: ABdhPJxrYFpQ57bnpubdkGswwPpvUqiSoxwM+x4xa5E+Bm9R1moOZDB7GOV+0ub4bCB5zP11aicuNs+pxfrh6sHsufc= X-Received: by 2002:a05:622a:144f:: with SMTP id v15mr22704828qtx.340.1637213578473; Wed, 17 Nov 2021 21:32:58 -0800 (PST) List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 References: <202111032055.1A3KtLQX071805@gitrepo.freebsd.org> In-Reply-To: From: Kyle Evans Date: Wed, 17 Nov 2021 23:32:47 -0600 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: git: 589aed00e36c - main - sched: separate out schedinit_ap() To: Mark Johnston Cc: Konstantin Belousov , src-committers , "" , dev-commits-src-main@freebsd.org Content-Type: text/plain; charset="UTF-8" X-ThisMailContainsUnwantedMimeParts: N On Wed, Nov 17, 2021 at 5:25 PM Mark Johnston wrote: > > On Thu, Nov 18, 2021 at 01:10:17AM +0200, Konstantin Belousov wrote: > > On Wed, Nov 17, 2021 at 04:44:29PM -0600, Kyle Evans wrote: > > > On Wed, Nov 3, 2021 at 3:55 PM Kyle Evans wrote: > > > > > > > > The branch main has been updated by kevans: > > > > > > > > URL: https://cgit.FreeBSD.org/src/commit/?id=589aed00e36c22733d3fd9c9016deccf074830b1 > > > > > > > > commit 589aed00e36c22733d3fd9c9016deccf074830b1 > > > > Author: Kyle Evans > > > > AuthorDate: 2021-11-02 18:06:47 +0000 > > > > Commit: Kyle Evans > > > > CommitDate: 2021-11-03 20:54:59 +0000 > > > > > > > > sched: separate out schedinit_ap() > > > > > > > > schedinit_ap() sets up an AP for a later call to sched_throw(NULL). > > > > > > > > Currently, ULE sets up some pcpu bits and fixes the idlethread lock with > > > > a call to sched_throw(NULL); this results in a window where curthread is > > > > setup in platforms' init_secondary(), but it has the wrong td_lock. > > > > Typical platform AP startup procedure looks something like: > > > > > > > > - Setup curthread > > > > - ... other stuff, including cpu_initclocks_ap() > > > > - Signal smp_started > > > > - sched_throw(NULL) to enter the scheduler > > > > > > > > cpu_initclocks_ap() may have callouts to process (e.g., nvme) and > > > > attempt to sched_add() for this AP, but this attempt fails because > > > > of the noted violated assumption leading to locking heartburn in > > > > sched_setpreempt(). > > > > > > > > Interrupts are still disabled until cpu_throw() so we're not really at > > > > risk of being preempted -- just let the scheduler in on it a little > > > > earlier as part of setting up curthread. > > > > > > > > > > What's the general consensus on potential out-of-tree archs maintained > > > on stable branches? I'd like to MFC this at least to stable/13 to > > > avoid it being in the way of the nvme change that spurred it, and I'm > > > trying to decide if it should have something like this added to make > > > it safe: > > I do not believe that we even think of guaranteeing this level of source > > stability. > > At first I assumed this was referencing sparc64, but that is not present > in stable/13 either. I believe stable/13 and main support the same set > of platforms, in which case I agree that we shouldn't bother with trying > to provide extra compatibility, and I think it's probably not necessary > to merge this to 12. Thanks, folks! This was mainly for theoretical scenarios like some downstream maintaining, e.g., ia64 on their own stable/13. This is also trivial to fix for such a scenario, though, and the breakage would be obvious. Agreed re: stable/12; imp didn't seem to have much appetite for merging his nvme changes back that far (while stable/13 was within scope), so I'm not inclined to go that far either. Thanks! Kyle Evans