Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp517256rwb; Thu, 18 Aug 2022 07:43:25 -0700 (PDT) X-Google-Smtp-Source: AA6agR7bN7E5ID/1es+MRLjWji3h+u/ECJejOoiuwzI9qQZIJoJZlhuyUcytsKIdOSFJ7LAwygSd X-Received: by 2002:a05:6402:3886:b0:446:1439:5385 with SMTP id fd6-20020a056402388600b0044614395385mr2066818edb.113.1660833805235; Thu, 18 Aug 2022 07:43:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660833805; cv=none; d=google.com; s=arc-20160816; b=ducRPZO70cF6hH3Gy1Yn8a/6OZ4lzST9KNbKqEMqBT8wfN79klYeqmx4SKuARUXbxZ LzWZUTp+RjoaQxFTm0x4kOiFlixL0vbtfS1qExIIV1+bAO0D9x1X0DysrC7N5j4iCkN3 1j0oAcnYwsdF8NVMUxEDvZgoGBEKhiMvWPqEvkb6B6+3Md6b5TdVy3Ra+SYU2YN3uhck ZRQJZpBIER0VauyQVFOa4miRCR3bOTwvLhS7LcTRbK6oGC39T0P0XJTQJFE6iyOAHkfv obbjDcNWB4B6rLQ6Qzua4dWjNdLMvtRQcmNe/8mqb+uG+ZmALgXihhnZx6VfAxV1y2CT xfvQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature:dkim-signature; bh=jUOvmGlI7wKmxNcPCdGuGwwDa2NbX/abFNr9NqvjZw0=; b=nF42JOzyPvNBLme6Kb8mcgeqTWDlkvWEbQGG+PAmfAIqpSjAgiXsy9pPn+Yju7daCn whWciLQOCfzJBax93WGwCDXqD9iThEgmpp/fX0rBT3iDB+IIVVuCY8ZFBgwOTHHuzS4W /EnsKBpmltm8zrZDvNHOcXYH64rJdN8LkleNDzsqDqJQC+Dgw/1uxT2ameQlRTYY3AMA lB8H6rs3ndeuzrk3jztXgCModQCFyIy2UL98wbuqXxAAzjyWdM0LCXL/g/Wd200z6skJ HG9+XsWl/wE/S85JtWP5dTFe/MjW+bCjy2+FPhz8caooFER786UreU4TlU+//mXeatCE VoCA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=WTIWY82T; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s1-20020a17090699c100b0073c1d6b30fbsi849244ejn.355.2022.08.18.07.42.57; Thu, 18 Aug 2022 07:43:25 -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=@suse.cz header.s=susede2_rsa header.b=WTIWY82T; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245631AbiHROin (ORCPT + 99 others); Thu, 18 Aug 2022 10:38:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36442 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S245646AbiHROil (ORCPT ); Thu, 18 Aug 2022 10:38:41 -0400 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 03D042A27B for ; Thu, 18 Aug 2022 07:38:40 -0700 (PDT) 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 X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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 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.