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 47026C00140 for ; Thu, 18 Aug 2022 22:14:04 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id B54B48D0002; Thu, 18 Aug 2022 18:14:03 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id ADDEB8D0001; Thu, 18 Aug 2022 18:14:03 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 956628D0002; Thu, 18 Aug 2022 18:14:03 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id 82B998D0001 for ; Thu, 18 Aug 2022 18:14:03 -0400 (EDT) Received: from smtpin11.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id 5C779A0BC8 for ; Thu, 18 Aug 2022 22:14:03 +0000 (UTC) X-FDA: 79814117166.11.E3DECAE Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by imf02.hostedemail.com (Postfix) with ESMTP id 60FB885444 for ; Thu, 18 Aug 2022 21:33:58 +0000 (UTC) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id AED423F1B0; Thu, 18 Aug 2022 14:38:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1660833518; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=jUOvmGlI7wKmxNcPCdGuGwwDa2NbX/abFNr9NqvjZw0=; b=WTIWY82Tw3Hdv5YfNhdNbZM8aNcndiPzlXWodezlbSWP76veCfJVWjrJRKLlP4PpYEP5Dz t4jwu7T0cSGfyQoAApWGJ6k39sZ8cq/C5QGyp3jaTn9GiJXy0jCbRiWUe7IvV7Zx/i4svV 8WCM+aoixUtRivXbxcgX5ZnquJ3Q/ow= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1660833518; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=jUOvmGlI7wKmxNcPCdGuGwwDa2NbX/abFNr9NqvjZw0=; b=Qvtj/6cdFermErecQBQFHbe+hG4VSqe3HCWyLb1VdkqMFe7kYXdMih9LM1ncjvIeE7EDOa bhh8Bd9qWXAQkDCw== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 0F466139B7; Thu, 18 Aug 2022 14:38:38 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id BYdTAe5O/mJ0AQAAMHmgww (envelope-from ); Thu, 18 Aug 2022 14:38:38 +0000 Message-ID: <5679405a-b3c3-6dc5-783f-7ebeda7c9bf0@suse.cz> Date: Thu, 18 Aug 2022 16:37:06 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.11.0 Subject: Re: [PATCH 1/9] slub: Make PREEMPT_RT support less convoluted Content-Language: en-US To: Christoph Lameter , Sebastian Andrzej Siewior Cc: 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 References: <20220817162703.728679-1-bigeasy@linutronix.de> <20220817162703.728679-2-bigeasy@linutronix.de> From: Vlastimil Babka In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1660858438; a=rsa-sha256; cv=none; b=PFrQEUoaNOGGsFCdCcoSBd8RrVVWkcq0dhnKlgWzUdyogeAwsqV/rDUhhP3naXbWLSQtkX 4Bzqv5NVJumB29yx2Apor7AK1HbMt/cOcpX+B+gpxKKDOQsnfZmanJCrqz8ahUAHxnpILV QcICU0Xb4TXEuZHGz+uBigo8zKL4Vmg= ARC-Authentication-Results: i=1; imf02.hostedemail.com; dkim=pass header.d=suse.cz header.s=susede2_rsa header.b=WTIWY82T; dkim=pass header.d=suse.cz header.s=susede2_ed25519 header.b="Qvtj/6cd"; dmarc=none; spf=pass (imf02.hostedemail.com: domain of vbabka@suse.cz designates 195.135.220.28 as permitted sender) smtp.mailfrom=vbabka@suse.cz ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1660858438; 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:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=jUOvmGlI7wKmxNcPCdGuGwwDa2NbX/abFNr9NqvjZw0=; b=BhCSWKw29RCBHrHgGGkfILxJv4lUp5jOvPQRc+UVCokVHB9P0jsFQrWzPQwYp+2tF2bW9q 9xCJWuV2SVJOx1F13c0kOBKdKVuUyNHX9+3Flc3HbbneIlAf6W+l6JMk5xoBPdPDMarES0 dfQ0/NSJHi7QqvuvozX8AUS8VzYmdm8= X-Rspamd-Server: rspam06 X-Rspam-User: X-Stat-Signature: 54ci5and8dxkmuz6u1jjawxm958to7d9 Authentication-Results: imf02.hostedemail.com; dkim=pass header.d=suse.cz header.s=susede2_rsa header.b=WTIWY82T; dkim=pass header.d=suse.cz header.s=susede2_ed25519 header.b="Qvtj/6cd"; dmarc=none; spf=pass (imf02.hostedemail.com: domain of vbabka@suse.cz designates 195.135.220.28 as permitted sender) smtp.mailfrom=vbabka@suse.cz X-Rspamd-Queue-Id: 60FB885444 X-HE-Tag: 1660858438-994721 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 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. > fastpath does not require disabling preemption or interrupts if the > processor supports local rmv operations. So you should be able to use the > fastpath on PREEMPT_RT. > > If the fastpath is not possible then you need to disable preemption and > eventually take locks etc and then things may get a bit more complicated. Yeah that's basically the solution for PREEMPT_RT, take the local_lock.