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.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS 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 0B05AC07E96 for ; Tue, 6 Jul 2021 17:56:42 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 6B5C661C5D for ; Tue, 6 Jul 2021 17:56:41 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6B5C661C5D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmx.de Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 11F936B0071; Tue, 6 Jul 2021 13:56:41 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 0A9E36B0072; Tue, 6 Jul 2021 13:56:41 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E3DEE6B0073; Tue, 6 Jul 2021 13:56:40 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0168.hostedemail.com [216.40.44.168]) by kanga.kvack.org (Postfix) with ESMTP id B72186B0071 for ; Tue, 6 Jul 2021 13:56:40 -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 158BF8249980 for ; Tue, 6 Jul 2021 17:56:40 +0000 (UTC) X-FDA: 78332918160.23.2C9F04D Received: from mout.gmx.net (mout.gmx.net [212.227.15.18]) by imf02.hostedemail.com (Postfix) with ESMTP id 7BAB07001A06 for ; Tue, 6 Jul 2021 17:56:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1625594192; bh=1XW4QZUxLpFU4VF+uKupXJzAACbI5Ar5k3bwRpoIlt4=; h=X-UI-Sender-Class:Subject:From:To:Cc:Date:In-Reply-To:References; b=af2h8Y9QvMWShXfQhwxwem7jcmCclZRG9e+H+ZKggbUCZw0jWMtRdvg6gINy9zT/A OzJkUjFZInVp1GRigQ7p/lSUYSUmZaHIDN3aApMNfL6xg9iHsF6aWY1MJnrueipw1A rde6ew7q5BCdXske0ob32nm9CQs7B2inJ58rTuf4= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from homer.fritz.box ([185.191.216.125]) by mail.gmx.net (mrgmx005 [212.227.17.190]) with ESMTPSA (Nemesis) id 1MYeMj-1lfjvP0nyd-00ViSa; Tue, 06 Jul 2021 19:56:32 +0200 Message-ID: <289873432407e0569401c8894843d7004b59d90b.camel@gmx.de> Subject: Re: [RFC v2 00/34] SLUB: reduce irq disabled scope and make it RT compatible From: Mike Galbraith To: Sebastian Andrzej Siewior , Vlastimil Babka 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 Date: Tue, 06 Jul 2021 19:56:29 +0200 In-Reply-To: <206d6a81e08cb23a2c97e67335be6017e938bac5.camel@gmx.de> References: <20210609113903.1421-1-vbabka@suse.cz> <20210702182944.lqa7o2a25to6czju@linutronix.de> <206d6a81e08cb23a2c97e67335be6017e938bac5.camel@gmx.de> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.34.4 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:Pyc2JwVoSC5bEXh9SltN3cjAdn1IIP3fzD+eYhnrLmjmsRO/VLP 7FqwdgZRZaAvAxWbRkL0qV99b8uJ7dPz4XXCl9v91XLPtGuG89T+alvMs/7LoTW0DzEI/Un RXJw4tYegxY7Y+QlSTKEqdYOEKP30HCVIOwwLrLAFPl4jf6ETUdEePuPOqW5/M91BJtfHj8 F7n0nRl3/9868p+n/SL5Q== X-UI-Out-Filterresults: notjunk:1;V03:K0:TbtWtwMGRTY=:eCpL0/ITpHvkekAKORADYv HeRB5BlbzUnydLlH24iFjpXrvNpUXpzU/2SvOmEPPRYyicYztjS+Q4bHc52rT+QdAG1hCGIRI V4F6Dv5J2ldU0/igMOoVP0C01tPvqMaxFtE4faTAxtDW4eDcMnoBor3zzkIL6yF5RtS50JqS4 /0cTWAor5TaJvoeuf+zLtSVZ+kERIp9da3WU2UphrSU5TY5A9RK5L0ZEklU1VBXFAXQBzxWce gMcxsOgNyA8ScWaZ4Id3/kHGt2mAoefbLTMFIVy4VY6W6xYqWaYC4KQPUOUM2nbqifdah6ubN epxQYw0B398BiRllsLU2vgts9DvdhuanqTxkHBPWJVii8y2rQq3Z5gbdnO/rtvt726hUrLtGr eBLTUh80tNlZ1NxugVPQD2HMY45xdzYcMwlGK5lcruw8ZvpyInIokZdzTJ6GACJeOV4uX1vuW ulTK9Xz+Z3PSC1C2/kFIhap5p7m+h0PNO3u4eeHV2HP1s28mGu2tlyWjZ94S7eDGurTo8tx9Q 95iFlHdKrfoeFbDUcKfA6zL+ICCITVy9pGBWp4udWgofpxcUivZERRxtQB4tRydyUjTBAaPqN o4J7MHH1s/V32axFaphofU6LLgt6q+zQHyfKdOZlpsmHJoJrEgv4HKgitU6lS9xluynVnenX7 LH2Ms+maMUomL3fHhmLvLLt3R+b4/B1s7anKGDmmn87HxfQhEIglS9FectnKU7PuhiZHWjNPk ghlSD64389ZKO/eLdjx+6r57ifFuVUOX28DSIv3SYT0eu9qzhmArNJsmkCzU7RjVuwprGRcxT quvooOCP4sfXUaYXaVsNvN5XO92LbJ8NPdk9UAURj7XybqWQMYopWRX6qLJGSMVHx2OOyunWU GvsZAumfyvJux58R5iVqjZjbMvicdy0lupoHwvMUgHcUFFiyyUUdvU0xOa2uXflokrdeH4csZ S5GjqNHkqpBUIllc9ol24fgh1ofOb+DhlKP/XdSMfZdEuYQe/vlubgc0WT8LCqYcjzVHHNPQO nlzc1kiWIEQbr6rqNo+SIDi+jjuVCQyOHXdLpDr9WqsLFlb7f678An1PN0vz+pbB6Ao1eN7+m dizrCx1dq+dI/evP5/tvWcy8wSmYFherXEp Authentication-Results: imf02.hostedemail.com; dkim=pass header.d=gmx.net header.s=badeba3b8450 header.b=af2h8Y9Q; dmarc=pass (policy=none) header.from=gmx.de; spf=pass (imf02.hostedemail.com: domain of efault@gmx.de designates 212.227.15.18 as permitted sender) smtp.mailfrom=efault@gmx.de X-Rspamd-Server: rspam02 X-Stat-Signature: 3n5ijra6w6orwbmgutzbf51ndiwzn8sd X-Rspamd-Queue-Id: 7BAB07001A06 X-HE-Tag: 1625594199-227642 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 Mon, 2021-07-05 at 18:00 +0200, Mike Galbraith wrote: > On Fri, 2021-07-02 at 20:29 +0200, Sebastian Andrzej Siewior wrote: > > > > > The remaining patches to upstream from the RT tree are small ones > > > related to KConfig. The patch that restricts PREEMPT_RT to SLUB > > > (not SLAB or SLOB) makes sense. The patch that disables > > > CONFIG_SLUB_CPU_PARTIAL with PREEMPT_RT could perhaps be re- > > > evaluated as the series also addresses some latency issues with > > > percpu partial slabs. > > > > With that series the PARTIAL slab can be indeed enabled. I have > > (had) > > a half done series where I had PARTIAL enabled and noticed a slight > > increase in latency so made it "default y on !RT". It wasn't > > dramatic > > but appeared to be outside of noise. > > I'm seeing warnings/explosions while exercising box IFF PARTIAL slab > thingy is enabled. I aborted -PARTIAL after a little over 4 hours, > whereas the longest survival of 4 +PARTIAL runs was 50 minutes, so > I'm fairly confident that PARTIAL really really is the trigger. Resurrecting local exclusion around unfreeze_partials() seems to have put an end to that. Guess I can chop these trees down now. =2D-- mm/slub.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) =2D-- a/mm/slub.c +++ b/mm/slub.c @@ -2497,7 +2497,9 @@ static void put_cpu_partial(struct kmem_ * partial array is full. Move the existing * set to the per node partial list. */ + local_lock(&s->cpu_slab->lock); unfreeze_partials(s); + local_unlock(&s->cpu_slab->lock); oldpage =3D NULL; pobjects =3D 0; pages =3D 0; @@ -2579,7 +2581,9 @@ static void flush_cpu_slab(struct work_s if (c->page) flush_slab(s, c, true); + local_lock(&s->cpu_slab->lock); unfreeze_partials(s); + local_unlock(&s->cpu_slab->lock); } static bool has_cpu_slab(int cpu, struct kmem_cache *s) @@ -3358,13 +3362,12 @@ static __always_inline void do_slab_free * we need to take the local_lock. We shouldn't simply defer to * __slab_free() as that wouldn't use the cpu freelist at all. */ - unsigned long flags; void **freelist; - local_lock_irqsave(&s->cpu_slab->lock, flags); + local_lock(&s->cpu_slab->lock); c =3D this_cpu_ptr(s->cpu_slab); if (unlikely(page !=3D c->page)) { - local_unlock_irqrestore(&s->cpu_slab->lock, flags); + local_unlock(&s->cpu_slab->lock); goto redo; } tid =3D c->tid; @@ -3374,7 +3377,7 @@ static __always_inline void do_slab_free c->freelist =3D head; c->tid =3D next_tid(tid); - local_unlock_irqrestore(&s->cpu_slab->lock, flags); + local_unlock(&s->cpu_slab->lock); #endif stat(s, FREE_FASTPATH); } else @@ -3601,7 +3604,7 @@ int kmem_cache_alloc_bulk(struct kmem_ca slab_want_init_on_alloc(flags, s)); return i; error: - local_unlock_irq(&s->cpu_slab->lock); + slub_put_cpu_ptr(s->cpu_slab); slab_post_alloc_hook(s, objcg, flags, i, p, false); __kmem_cache_free_bulk(s, i, p); return 0;