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 X-Spam-Level: X-Spam-Status: No, score=-5.2 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A, SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7CE5AC4338F for ; Thu, 29 Jul 2021 14:17:30 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id C02D260F42 for ; Thu, 29 Jul 2021 14:17:29 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org C02D260F42 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.cz Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id 5DC128D0001; Thu, 29 Jul 2021 10:17:29 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 58C8F6B005D; Thu, 29 Jul 2021 10:17:29 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 42CE68D0001; Thu, 29 Jul 2021 10:17:29 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0153.hostedemail.com [216.40.44.153]) by kanga.kvack.org (Postfix) with ESMTP id 259D26B0036 for ; Thu, 29 Jul 2021 10:17:29 -0400 (EDT) Received: from smtpin23.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id CBC728249980 for ; Thu, 29 Jul 2021 14:17:28 +0000 (UTC) X-FDA: 78415828176.23.CE36027 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by imf10.hostedemail.com (Postfix) with ESMTP id 4F0F7600198D for ; Thu, 29 Jul 2021 14:17:28 +0000 (UTC) Received: from imap1.suse-dmz.suse.de (imap1.suse-dmz.suse.de [192.168.254.73]) (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-out2.suse.de (Postfix) with ESMTPS id 102B62003A; Thu, 29 Jul 2021 14:17:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1627568247; 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=esxEqsZ+wim6rej+gqT3oSNZBGX2GHfaW0zHlZ8O3ns=; b=K0wRHrtk/fKD4wHMDQ/cRmXbUT99VJGnHFjthN9eAdLklXvuW+jw694dNfOvEzb5hd0ANK wI+fmooDVk1r5fH9izVjN7A6RKqdYMh01phq+1DBg2EwmaYnd23xM945sBzld09B3NH1gi eFZfR0wgdeJtRTvJOpMdoUaiL4My/Og= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1627568247; 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=esxEqsZ+wim6rej+gqT3oSNZBGX2GHfaW0zHlZ8O3ns=; b=hFWQlNENf8Pt23k2OqZ00ZmTkscT8RIutKd3QWVafTgXljsowuSDHsMhtm/TPIS+ffXZ02 vmRqqsPygVC0RRDw== Received: from imap1.suse-dmz.suse.de (imap1.suse-dmz.suse.de [192.168.254.73]) (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 imap1.suse-dmz.suse.de (Postfix) with ESMTPS id D45C8136BF; Thu, 29 Jul 2021 14:17:26 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap1.suse-dmz.suse.de with ESMTPSA id iyqkMna4AmFZGAAAGKfGzw (envelope-from ); Thu, 29 Jul 2021 14:17:26 +0000 Subject: Re: [RFC v2 00/34] SLUB: reduce irq disabled scope and make it RT compatible To: Sebastian Andrzej Siewior Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, Christoph Lameter , David Rientjes , Pekka Enberg , Joonsoo Kim , Thomas Gleixner , Mel Gorman , Jesper Dangaard Brouer , Peter Zijlstra , Jann Horn References: <20210609113903.1421-1-vbabka@suse.cz> <20210702182944.lqa7o2a25to6czju@linutronix.de> <35b26e48-a96a-41b0-826e-43e43660c9d6@suse.cz> <20210729134939.iulryxjarhjmpugz@linutronix.de> From: Vlastimil Babka Message-ID: <627eddeb-3dc0-056e-ae07-f14c4b1a1b8e@suse.cz> Date: Thu, 29 Jul 2021 16:17:26 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.12.0 MIME-Version: 1.0 In-Reply-To: <20210729134939.iulryxjarhjmpugz@linutronix.de> Content-Type: text/plain; charset=utf-8 Content-Language: en-US X-Rspamd-Server: rspam03 X-Rspamd-Queue-Id: 4F0F7600198D Authentication-Results: imf10.hostedemail.com; dkim=pass header.d=suse.cz header.s=susede2_rsa header.b=K0wRHrtk; dkim=pass header.d=suse.cz header.s=susede2_ed25519 header.b=hFWQlNEN; dmarc=none; spf=pass (imf10.hostedemail.com: domain of vbabka@suse.cz designates 195.135.220.29 as permitted sender) smtp.mailfrom=vbabka@suse.cz X-Stat-Signature: cr7sb3c4y9hn5atm4zn7gqucrq736bp8 X-HE-Tag: 1627568248-217688 Content-Transfer-Encoding: quoted-printable 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 7/29/21 3:49 PM, Sebastian Andrzej Siewior wrote: > now that I'm slowly catching up=E2=80=A6 >=20 > On 2021-07-02 22:25:05 [+0200], Vlastimil Babka wrote: >> > - perf_5.10 stat -r 10 hackbench -g200 -s 4096 -l500 >> > Old: >> > | 464.967,20 msec task-clock # 27,220 CPUs = utilized ( +- 0,16% ) >> > New: >> > | 422.865,71 msec task-clock # 4,782 CPUs = utilized ( +- 0,34% ) >>=20 >> The series shouldn't significantly change the memory allocator >> interaction, though. >> Seems there's less cycles, but more time elapsed, thus more sleeping - >> is it locks becoming mutexes on RT? >=20 > yes, most likely since the !RT parts are mostly unchanged. >=20 >> My second guess - list_lock remains spinlock with my series, thus RT >> mutex, but the current RT tree converts it to raw_spinlock. I'd hope >> leaving that one as non-raw spinlock would still be much better for RT >> goals, even if hackbench (which is AFAIK very slab intensive) throughp= ut >> regresses - hopefully not that much. >=20 > Yes, the list_lock seems to be the case. I picked your > slub-local-lock-v3r0 and changed the list_lock (+slab_lock()) to use > raw_spinlock_t and disable interrupts and CPUs utilisation went to > ~23CPUs (plus a bunch of warnings which probably made it a little slowe= r > again). I forgot to point that out in the cover letter, but with v3 this change t= o raw_spinlock_t is AFAICS no longer possible (at least with CONFIG_SLUB_CPU_PARTIAL) because in put_cpu_partial() we now take the loc= al_lock and it can be called from get_partial_node() which takes the list_lock. > The difference between a sleeping lock (spinlock_t) and a mutex is > that we attempt not to preempt a task that acquired a spinlock_t even i= f > it is running for some time and the scheduler would preempt it (like it > would do if the task had a mutex acquired. These are the "lazy preempt" > bits in the RT patch). >=20 > By making the list_lock a raw_spinlock_t a lot of IRQ-flags dancing > needs to be done as the page-allocator must be entered with enabled > interrupts. Hm but SLUB should never call the page allocator from under list_lock in = my series? > And then there is the possibility that you may need to free > some memory even if you allocate memory which requires some extra steps > on RT due to the IRQ-off part. All this vanishes by keeping list_lock a > spinlock_t. > The kernel-build test on /dev/shm remained unchanged so that is good. > Unless there is a real-world use-case, that gets worse, I don't mind > keeping the spinlock_t here. I haven't seen tglx complaining so far. Good. IIRC hackbench is very close to being a slab microbenchmark, so regressions there are expected, but should not translate to notable real = world regressions. > Sebastian >=20