From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8249FC32771 for ; Fri, 19 Aug 2022 15:04:36 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 973CB8D0003; Fri, 19 Aug 2022 11:04:35 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 922D98D0002; Fri, 19 Aug 2022 11:04:35 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 812E98D0003; Fri, 19 Aug 2022 11:04:35 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 74F748D0002 for ; Fri, 19 Aug 2022 11:04:35 -0400 (EDT) Received: from smtpin26.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 36D081418E3 for ; Fri, 19 Aug 2022 15:04:35 +0000 (UTC) X-FDA: 79816663710.26.AB260C5 Received: from gentwo.de (gentwo.de [161.97.139.209]) by imf07.hostedemail.com (Postfix) with ESMTP id 3C41740006 for ; Fri, 19 Aug 2022 15:04:33 +0000 (UTC) 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 ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1660921474; a=rsa-sha256; cv=none; b=tKuH3KAppIt8WKLGJgVoOQgjtYtJLXcR8LTfiPeh01HWiDGlYA8f3FMDaIagO6N2UFj75N CxEx2ky9jEBlOUh57AO6I//PdVXRv/fcIE3XSAlYYR/5Nw9irBE7PAj+TlWODfarByEXwh KsR8BI+4OZldpMbABx4JHQTl60gB77o= ARC-Authentication-Results: i=1; imf07.hostedemail.com; dkim=none ("invalid DKIM record") header.d=gentwo.de header.s=default header.b=ADwEwQqc; dmarc=pass (policy=none) header.from=gentwo.de; spf=pass (imf07.hostedemail.com: domain of cl@gentwo.de designates 161.97.139.209 as permitted sender) smtp.mailfrom=cl@gentwo.de ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1660921474; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=YEVtrdlvOKwxdkzl8XwlHr3gHaB9eDWGUm+bSMLcPN8=; b=C0y+juydeFcJpGPf10P0hlWAorwbMzy46gmK80cQEOUsK8xGUZPFRNOXRtYp/K4VGIMv4/ NAgNXpQi5i3UsWqePqi58pWu87jKS598D5IGTlHHWFGgs219cZqUVNLxVHJGl4z+ecNpWr AWcf3m+fIcrJX+hkJDc60AEcwTeFlug= X-Rspamd-Server: rspam06 X-Rspam-User: X-Stat-Signature: 6u3ikc6twgpyrhstmsyha4gjd6rhmk5o Authentication-Results: imf07.hostedemail.com; dkim=none ("invalid DKIM record") header.d=gentwo.de header.s=default header.b=ADwEwQqc; dmarc=pass (policy=none) header.from=gentwo.de; spf=pass (imf07.hostedemail.com: domain of cl@gentwo.de designates 161.97.139.209 as permitted sender) smtp.mailfrom=cl@gentwo.de X-Rspamd-Queue-Id: 3C41740006 X-HE-Tag: 1660921473-926215 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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.