Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp1724066rwb; Fri, 19 Aug 2022 08:21:15 -0700 (PDT) X-Google-Smtp-Source: AA6agR6Mu4/MZj0WxyJuKwmuLupALzy/zLqI9WYiEVxuYmHHPzQAbFSMb1QrKTzajGv0RTN/Kv/A X-Received: by 2002:a05:6402:3552:b0:43d:a634:3997 with SMTP id f18-20020a056402355200b0043da6343997mr6384821edd.389.1660922474941; Fri, 19 Aug 2022 08:21:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660922474; cv=none; d=google.com; s=arc-20160816; b=zlV/EDSKHlFeL11825MX1i0sc9GsfM7WzwaEKAxvrPtMTd4/YWwat2PBsgBXbgnmwJ 7Xxg3pOblM5Xvg8IwFe7gOXUYZA+NwBYLdZp1CSraIr5vt4jKLXTQkKkLhygB4ImKVfw WoUNBIeCz6KOATs9AOOrhMk14GwaYNm9wqpEWmxJJoQAxaBNdxpJ7di7QPLePCncx7qM 4qd0tKGsrksr4M0e+BOJaMjyjm1H8o0k4HsLmpNdQK6jgsa4iT21f2n+4uy+EvEUEeHY tFvk3Cf6W8QH779s3MnTOhLVJ56AiZ7f8tkxrMx1+Um50aL3BiDTk0Sj6DNS5NETv0Sx wIdA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent:references:message-id :in-reply-to:subject:cc:to:from:date:dkim-signature; bh=YEVtrdlvOKwxdkzl8XwlHr3gHaB9eDWGUm+bSMLcPN8=; b=wg8zqiuU2z4TYMn8AogRabdz1aROw2ysQMntdQ1kE6m5Hl0jaAmtZbunhkh/PyT41t 8bp3XCrzRMjnubxpm4yvgEDSjQ0OtV6Q56gx2WLtsqAXSL+5A8rnI7xmLL1Ed5M23bms EEV/DT/P2oQKtvn3ebGU7tjZ6NxCHaNtePzpLqPiwvs84qRX18o38la4F+mtp97lQBY4 vBv9BZ7GYCnjT/T5xFZkh6fCQU4TLDWkKW9sMuThKiGAGUcuQQJPiBJU5qlhoah4AiNH p+TzKo0cUcT0rjt6CUruXEgQybwx+tgOBFooXYt1UreQ2Zm7xK4ghLcch9WIg5EYMJf+ xopQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gentwo.de header.s=default header.b=ADwEwQqc; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gentwo.de Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id cr11-20020a056402222b00b0043bdf9b0ff5si2624074edb.443.2022.08.19.08.20.48; Fri, 19 Aug 2022 08:21:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gentwo.de header.s=default header.b=ADwEwQqc; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gentwo.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1349211AbiHSPEi (ORCPT + 99 others); Fri, 19 Aug 2022 11:04:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47196 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1348481AbiHSPEg (ORCPT ); Fri, 19 Aug 2022 11:04:36 -0400 Received: from gentwo.de (gentwo.de [161.97.139.209]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1CBD013F0A for ; Fri, 19 Aug 2022 08:04:33 -0700 (PDT) Received: by gentwo.de (Postfix, from userid 1001) id 08529B002B2; Fri, 19 Aug 2022 17:04:31 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gentwo.de; s=default; t=1660921471; bh=5DyeToWHhZNBwOW6jru0T77NoIDQPfqjDLXEgwCrlq4=; h=Date:From:To:cc:Subject:In-Reply-To:References:From; b=ADwEwQqctMcgBjkKLmPlBONjSN8AspuVzdEciBmIirDuQJh68oLi3S8gY5qaQhxKL 0s5rToJVV4iBB1xstm+l8qDyxlmRpOpZ4axRc3J+0sGglqqZnEGcsaWiSb1ewDe6Wt oOXA5EvL9rxDPB6DqtjhHaMwcP0WxhiV3pBOB3oJu2st/FVqr6Lee50LW3F4d/IRe5 LqmCEZdEkdHKeDHo9JHZxJYdVExPC+nqPOA6Ix6a6OHNuD3ucp1i/Sjk64LedHsai+ yYy9uo4YYwPgLN85U4NSH2wPFnyqDcbMRzWRfpJkTfb2ix9x0rWNlRTyR83Q4gS8Rj yYYTG1xanwPpQ== Received: from localhost (localhost [127.0.0.1]) by gentwo.de (Postfix) with ESMTP id 0681AB00241; Fri, 19 Aug 2022 17:04:31 +0200 (CEST) Date: Fri, 19 Aug 2022 17:04:31 +0200 (CEST) From: Christoph Lameter To: Vlastimil Babka cc: Sebastian Andrzej Siewior , linux-kernel@vger.kernel.org, Thomas Gleixner , Peter Zijlstra , Steven Rostedt , Linus Torvalds , Matthew Wilcox , Andrew Morton , David Rientjes , Joonsoo Kim , Pekka Enberg , linux-mm@kvack.org Subject: Re: [PATCH 1/9] slub: Make PREEMPT_RT support less convoluted In-Reply-To: <5679405a-b3c3-6dc5-783f-7ebeda7c9bf0@suse.cz> Message-ID: References: <20220817162703.728679-1-bigeasy@linutronix.de> <20220817162703.728679-2-bigeasy@linutronix.de> <5679405a-b3c3-6dc5-783f-7ebeda7c9bf0@suse.cz> User-Agent: Alpine 2.22 (DEB 394 2020-01-19) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_PASS,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 18 Aug 2022, Vlastimil Babka wrote: > On 8/18/22 11:42, Christoph Lameter wrote: > > On Wed, 17 Aug 2022, Sebastian Andrzej Siewior wrote: > > > >> + * On PREEMPT_RT, the local lock neither disables interrupts nor preemption > >> + * which means the lockless fastpath cannot be used as it might interfere with > >> + * an in-progress slow path operations. In this case the local lock is always > >> + * taken but it still utilizes the freelist for the common operations. > > > > The slub fastpath does not interfere with slow path operations and the > > That's true on !PREEMPT_RT because a slowpath operation under > local_lock_irqsave() will disable interrupts, so there can't be a > fastpath operation in an interrupt handler appearing in the middle of a > slowpath operation. > > On PREEMPT_RT local_lock_irqsave() doesn't actually disable interrupts, > so that can happen. IIRC we learned that the hard way when Mike > Galbraith was testing early versions of my PREEMPT_RT changes for SLUB. Well yes if you enable interrupts during the slowpath then interrupts may use the fastpath. That is a basic design change to the way concurrency is handled in the allocators. There needs to be some fix here to restore the exclusion of the fastpath during slow path processing. This could be A) Exclude the fastpath during slowpath operations This can be accomplished by setting things up like in the debug mode that also excludes the fastpath. or B) Force interrupt allocations to the slowpath. Check some flag that indicates an interrupt allocation is occurring and then bypass the fastpath.