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,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,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 BA587C433EF for ; Thu, 2 Sep 2021 23:34:26 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 3535360FDC for ; Thu, 2 Sep 2021 23:34:26 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 3535360FDC Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=linux-foundation.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id C55326B0071; Thu, 2 Sep 2021 19:34:25 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id C05F56B0072; Thu, 2 Sep 2021 19:34:25 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id AA5F16B0073; Thu, 2 Sep 2021 19:34:25 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id 9CC946B0071 for ; Thu, 2 Sep 2021 19:34:25 -0400 (EDT) Received: from smtpin27.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 5DBCC82F3BE6 for ; Thu, 2 Sep 2021 23:34:25 +0000 (UTC) X-FDA: 78544239690.27.40D1B9C Received: from mail-lj1-f172.google.com (mail-lj1-f172.google.com [209.85.208.172]) by imf20.hostedemail.com (Postfix) with ESMTP id 1D2A7D0000AA for ; Thu, 2 Sep 2021 23:34:24 +0000 (UTC) Received: by mail-lj1-f172.google.com with SMTP id m4so6631173ljq.8 for ; Thu, 02 Sep 2021 16:34:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=FhHbT0k3VC2tPvsRChNb1C001MACcH/2A6uABZ9AEMA=; b=eLOhRSEZxRSXfBVtB0sVn7xKo2ulhfYQsNLW2u7WcRa4+H0OLpTitXi64KTxUQS3zn +EetTfv2b1U9zUDa7vdfZ1E2pzMQNjj5Gqf3/Ku+TxzD1tbjNmYH6aaKkGK96kaUmnjc tlpCJMrDRHbWUM6HVlBQ7fn3UQOXfVH6ZQAy0= 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=FhHbT0k3VC2tPvsRChNb1C001MACcH/2A6uABZ9AEMA=; b=PnTYLB1XaBZt71Jp1/7/Yr+RELhqR+sZh6yt5b1/Oblufuoc+I7eZazdibBR8WDkQ/ e3n/Qtx4dcbYULZ2G5eHMjolpiZ7cCY3qMzI3Ouer4HxOS9DE5LQbb2tiu2s2Pk41Uko TvVPNlUFKkKt0t+iYtPgk7RZ6wyuHp+y0RJMEKdHvPglOZCyE9MmiLkuwJkKoT9QwwRO hXm5Wyyuiw4LzzilCRxd6oO+snczlnZa0ZTsFbIrDMhBGAke7HL6AKE0qCTytdzg29mv HTFv7khDRmvtdlKrgjINRyJ3G0tJIIYqzMkjvprYOKREcloHwBvTa6zjfFEe15y+wNVW 76yQ== X-Gm-Message-State: AOAM532crJbGBVO4F/b5MPre/M4C+OogvwO9h9Nob0gAE7APaXRABnW3 KT/pgix8qLqdRQKzjMSitbIK43QhzCWhujTpwOI= X-Google-Smtp-Source: ABdhPJyrKTu7xRu5Do4b8Eq1OOCJ6cqCBOvTy6yatKkjfPNcvjtdiQcwoKPz2ebYvdWBRguEiCUGtQ== X-Received: by 2002:a2e:870f:: with SMTP id m15mr633204lji.169.1630625663314; Thu, 02 Sep 2021 16:34:23 -0700 (PDT) Received: from mail-lj1-f173.google.com (mail-lj1-f173.google.com. [209.85.208.173]) by smtp.gmail.com with ESMTPSA id a23sm391811ljb.95.2021.09.02.16.34.22 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 02 Sep 2021 16:34:22 -0700 (PDT) Received: by mail-lj1-f173.google.com with SMTP id h1so6616248ljl.9 for ; Thu, 02 Sep 2021 16:34:22 -0700 (PDT) X-Received: by 2002:a2e:8808:: with SMTP id x8mr653887ljh.220.1630625662403; Thu, 02 Sep 2021 16:34:22 -0700 (PDT) MIME-Version: 1.0 References: <20210902144820.78957dff93d7bea620d55a89@linux-foundation.org> <20210902215152.ibWfL_bvd%akpm@linux-foundation.org> In-Reply-To: From: Linus Torvalds Date: Thu, 2 Sep 2021 16:34:06 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [patch 036/212] mm, slab: make flush_slab() possible to call with irqs enabled To: Andrew Morton Cc: Sebastian Andrzej Siewior , Jesper Dangaard Brouer , Christoph Lameter , Mike Galbraith , Joonsoo Kim , Jann Horn , Linux-MM , Mel Gorman , mm-commits@vger.kernel.org, Pekka Enberg , David Rientjes , Thomas Gleixner , Vlastimil Babka Content-Type: text/plain; charset="UTF-8" Authentication-Results: imf20.hostedemail.com; dkim=pass header.d=linux-foundation.org header.s=google header.b=eLOhRSEZ; spf=pass (imf20.hostedemail.com: domain of torvalds@linuxfoundation.org designates 209.85.208.172 as permitted sender) smtp.mailfrom=torvalds@linuxfoundation.org; dmarc=none X-Stat-Signature: sf8uzr43xifnyiq6jtuakbn8b7e6cszp X-Rspamd-Queue-Id: 1D2A7D0000AA X-Rspamd-Server: rspam04 X-HE-Tag: 1630625664-636022 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 Thu, Sep 2, 2021 at 4:15 PM Linus Torvalds wrote: > > .... > > + if (lock) > > + local_irq_save(flags); > > with actively misleading names ("lock"? WTF? There's no lock there!) > and just disgusting semantics with conditionals etc. .. and I see that "mm, slub: convert kmem_cpu_slab protection to local_lock" makes that local_irq_save() make it use a local_lock, which may have been the cause of the naming. But that doesn't make my other objections about this go away. Instead of having it lock/unlock halfway through the function (and have magic "Oh, the caller already holds the lock, so don't lock" semantics except with misleading names) I really think that function should just have been split in two, and then the locked region can be minimized in the caller only taking it for the first part. Linus