Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp4563421pxj; Tue, 25 May 2021 10:45:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJws0wlZ2c1wa+06oNj5jHLhfBM5iqRy+ktb+64m7fAXG89Yr4ZKLqT+ohxWINJ84V2LQSLQ X-Received: by 2002:a50:d54c:: with SMTP id f12mr32331170edj.301.1621964726522; Tue, 25 May 2021 10:45:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621964726; cv=none; d=google.com; s=arc-20160816; b=FQZEceVY2ZS4BBIZ1arUhOSucSiMIuEh/LuXHwiyreABO6Ly2F9/soLtzMiPxOloKC JWYtKoBy1eOhwKs/HTxKeE6ly1jvmvNKYvVZapluhpYNUz76TaTXYmuhuSubp6wdREpy dVX1SJyq6+bgqk6YrmS7k2H2FLQRbx5n3S6Omm8XSyPXtlTuui6Gl4UboXwn/B3QD6S/ sly8Jemz4mHPPO/E0FxztLy9h/Q3qeg199JqwtmwX6BDmK0ClpX1hR5ZnPBpzow8Zozr d0sAjYUWPRqBJ+Prxilc1VrbmpMS/Bfe5LUjtScTZ+1hTIDsacX8SpauRoxHjL9F7CB4 TJ9Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=AlGDwi+fKb5zDo0UgCxQb6+0ejL9MD7uZrEbLSa4Oto=; b=cmSyoCPs3YeRQ2qw6d4KyWxJs8Vso/SnXcuDjxv8/RSRIvR9xGVgTyTcDCbNzJQJK3 BETTst5RsCNRPbVQoZjgrVZjIK4Ud4uwvkPoM7OZwgjGmhoaYGSmRUpdHkXOFe01URmb 6hg8XBHvkePdEuKtyo9vApX56R9sZxhIchKq+8kAFpVdDDqsz+eZJbWyGyyMZfr7Bm7R P/0IYuC9gVl348+yk9FhwH3PbZhjFtMyCdCfTTcL66sk218PU4QiUmARObocX9YivEQK 18ztBBTfnmC7yyrwfnVxz2RPOLpT6WEB1y+bw7E6C5bXcFKdAOzrpqwlmAED1u9p2HT3 yQcw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=F8IoZ31v; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id q2si893843edw.144.2021.05.25.10.45.01; Tue, 25 May 2021 10:45:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=F8IoZ31v; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232065AbhEYQCW (ORCPT + 99 others); Tue, 25 May 2021 12:02:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40038 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230494AbhEYQCV (ORCPT ); Tue, 25 May 2021 12:02:21 -0400 Received: from mail-lj1-x22f.google.com (mail-lj1-x22f.google.com [IPv6:2a00:1450:4864:20::22f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 32CC7C061574 for ; Tue, 25 May 2021 09:00:51 -0700 (PDT) Received: by mail-lj1-x22f.google.com with SMTP id w15so38817162ljo.10 for ; Tue, 25 May 2021 09:00:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=AlGDwi+fKb5zDo0UgCxQb6+0ejL9MD7uZrEbLSa4Oto=; b=F8IoZ31vbu3JuKyp9XnxNMl6YxtNA2oECxMIbLi9v7US/TCuDrFIPmY876ESiknlBc cAKK1IAGOHcTMDm51QNr9q62Lx/yjQC4eiavpb6wfgGZnDi8R1R24k+pZ5+7OWIBjSnt f9C0aKQJlR8IR67wEbnAeeJWeez+R+6+5yuntCPH5gVMbHonthRDAgW1/EI5npLjF1vh hZx92RzdJKVaAhRzMmxq2psslRuA4eZJGhEzyNUOh/fFOHmlGJGhJ56xXtI4VCj4fZJv giLk1Ue6Dnsmns3bHjtEQwj0Oz8LWpgllGSbx2TmVO8qpVtEearWBhhmTpzH3st0oC99 Pf/A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=AlGDwi+fKb5zDo0UgCxQb6+0ejL9MD7uZrEbLSa4Oto=; b=Dam86gKqLfIsMPYG9c++J7UGYeskhOUcNy+Nc7R/fJE+9VIuzgoXZ6NiZYsvHhTOk5 HxvzfNfNNVnFRQ6CJwsC2qXA2xyD3d9iGVAmq76zGmxeiEBpNLs/I+cNA8LuvUky6D67 8dr5C+y+eAUF/e75yBuy8rfDTcXiK8j16HmI04GFEcrOTO8a2HMGjPdiN/dyoog7p/c6 JCi3bFB8Sdsme3KSBRtoqP9VWJXr39dzL0eCq/XKw0+CA3LYEcIrDZpMSgqvjhB2WOO4 WbAB/ZkO9UCvwmZ8RGOohs0iTgsZGFQPVcQ9+0YgOFnNKbYRgczC6dGU4cHpcraryVnS mvtg== X-Gm-Message-State: AOAM533YW2WsTtigKDxWY1Vs7PvvZmNeZdPYFwqpS2Zhh3zNFLQB3cHp fQdCAsvRTDH2f63eiFbazLVglXpNDHfB9KXCGz8CAA== X-Received: by 2002:a2e:b4ed:: with SMTP id s13mr21295934ljm.86.1621958449402; Tue, 25 May 2021 09:00:49 -0700 (PDT) MIME-Version: 1.0 References: <20210524233946.20352-1-vbabka@suse.cz> <20210524233946.20352-12-vbabka@suse.cz> In-Reply-To: <20210524233946.20352-12-vbabka@suse.cz> From: Jann Horn Date: Tue, 25 May 2021 18:00:23 +0200 Message-ID: Subject: Re: [RFC 11/26] mm, slub: move disabling irqs closer to get_partial() in ___slab_alloc() To: Vlastimil Babka Cc: Linux-MM , kernel list , Christoph Lameter , David Rientjes , Pekka Enberg , Joonsoo Kim , Sebastian Andrzej Siewior , Thomas Gleixner , Mel Gorman , Jesper Dangaard Brouer , Peter Zijlstra Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, May 25, 2021 at 1:40 AM Vlastimil Babka wrote: > Continue reducing the irq disabled scope. Check for per-cpu partial slabs with > first with irqs enabled and then recheck with irqs disabled before grabbing > the slab page. Mostly preparatory for the following patches. [...] > diff --git a/mm/slub.c b/mm/slub.c [...] > if (slub_percpu_partial(c)) { > + local_irq_save(flags); > + if (unlikely(c->page)) { > + local_irq_restore(flags); > + goto reread_page; > + } > + if (unlikely(!slub_percpu_partial(c))) /* stolen by IRQ? */ > + goto new_objects; nit: I think this comment is wrong by the end of the patch series, since at that point, in RT configurations, it could also be stolen by another task, if I understand correctly what migrate_disable() means? Similarly the comment above ___slab_alloc() still talks about disabling preemption for bulk allocation.