Received: by 2002:a05:7412:31a9:b0:e2:908c:2ebd with SMTP id et41csp3483867rdb; Wed, 13 Sep 2023 13:31:24 -0700 (PDT) X-Google-Smtp-Source: AGHT+IF8qZjntEPtkGEEs/NKZ47XUPbZXN+tcOrq2XVhgdln2/pg+mNXdDajWer0YPfe3qeSgrZ2 X-Received: by 2002:a05:6358:920d:b0:140:f00a:ee2c with SMTP id d13-20020a056358920d00b00140f00aee2cmr3649226rwb.11.1694637084242; Wed, 13 Sep 2023 13:31:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694637084; cv=none; d=google.com; s=arc-20160816; b=UtZMz1mulmCcBATZvCAClVUz4eBrAHJERBUYBbrL8qM5lslt6jLAisKXqbnGMjR0Ek EFFzrwbYEfH7UAoZ0Frxwd/nLdW8rad3TTs15Wuj1fH452dAcT3iYcVm0OYe9t/kDjLG 1js3Esd6WVxpa0jV+wFndAG2Q0Tpxwdqd0cttd3V9wTumepmUdKfubww3ICBQwkQF6Ac CL2pwkgv6NX+vIRBU0f8nD1C1jl4x/hWMOn5K5Ty1oXUDdbYVa/zq6tyuhM6ufQPXA+3 L5FsvfQglMKfTjGKuNtP8zykV7OgZd/t778PvLzmpVuRjz7Nu0AxNxtaA7yQUT1CP7FX 9pyw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=wp3RFNUyA36WKs+LwiEbI6IPse2t1rgKYPkaJa9C0u8=; fh=vhyMgzwtVf8Cd+Xluz+kIPeaZIksHpPCItLJmpWVnQM=; b=RWuCiXBfVmyg9w3/9I7SQP5XFlo1G8yLFH7Sn1gwmobgYr1wmD7AgzXJuLJInyL/7U Hso7ovsjEJDD/3/kDnJTOcSZcb6Vb31LVObYCaVEL8NmYd0TmlGpx3Iw1R0XmsdOsB1i pMR2P5Pz9hSlzpS5y5gGqoFWvPEAwp6x1YB5qdu5jxk0aJ7ozTynjjj8mIyKmM2TlIP3 27SvprTNeEsdu/0jEDCPKv1tBhyzFVzBSZpqkG+Sg6CsQy1kDC4kfyxqBL4g81wKTjfC 1Yr4NF7WI0am5vg0EgY5rLMPC61njXbDlIyonljwqMhpCsgPE6A6sTdI8wDkY1LOitUl 8Ksg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=l6iHoEqi; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from groat.vger.email (groat.vger.email. [2620:137:e000::3:5]) by mx.google.com with ESMTPS id g16-20020a633750000000b005652bd3d3absi4968852pgn.43.2023.09.13.13.31.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Sep 2023 13:31:24 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) client-ip=2620:137:e000::3:5; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=l6iHoEqi; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id 4813082357BD; Wed, 13 Sep 2023 10:09:51 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229472AbjIMRJt (ORCPT + 99 others); Wed, 13 Sep 2023 13:09:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59638 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229660AbjIMRJg (ORCPT ); Wed, 13 Sep 2023 13:09:36 -0400 Received: from mail-pj1-x102f.google.com (mail-pj1-x102f.google.com [IPv6:2607:f8b0:4864:20::102f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CD64F2698 for ; Wed, 13 Sep 2023 10:09:07 -0700 (PDT) Received: by mail-pj1-x102f.google.com with SMTP id 98e67ed59e1d1-26f57f02442so55242a91.0 for ; Wed, 13 Sep 2023 10:09:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1694624947; x=1695229747; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=wp3RFNUyA36WKs+LwiEbI6IPse2t1rgKYPkaJa9C0u8=; b=l6iHoEqiHmB+5EyqIZH2iCAfePHVATuunNVv3G9TJhy1QPkbrqgXn9Hh2myLc9Tcvr v6cTZ02np5aGyHuZ2rLnTJ1dEpRBiKl03dolp57DWqcT8lkbJqppw4rdJd/a2FrDwgp2 UhjwprFIxntcm6kgA9UhjCVLnIuHZdh8o8OV5h9vP/OJnZ9z8cCBSiIjl/Ce2paHH/Dm j2iwQmUX3oC3j0Aq78yUcDj6KJ39xsgeiai/dKkWGBk93za9GqVsawihCVocrO8Sksj2 Li2z+HlV8TRN5jM1PB95kAcUPbASgEhroswmvi0/IgDbf22GMyEcj7LYMwOU1nZr9chN db2A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1694624947; x=1695229747; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=wp3RFNUyA36WKs+LwiEbI6IPse2t1rgKYPkaJa9C0u8=; b=eZw2cML++FJkHXbYigObbZjrEkto/jtkaEdb2KkTcTFm1DM2Zf9hkZjVNsPy2raiHI jSxkBuObq5ELZqVk1Oq2JPx5P/quADfmjD+sUfmFZ3m59Z4BaBD7QHJ0kkkEfBqO2BhH XdHu0PCCMu6pXx4Z4rg8yf8jHmbr/m0NHO04bKH7FcdbA/5rm2p3/PvQLZff9laFBxuT dndW0xB8IxBT7JDvrXUnnIQJjgcmDT0KdaTuC4BeU6wJVKhWA0JflQR1X0T85yCcbNQj zCSBG55X4xRc+G6beytv9gJJZkXHpZeK71+a8ukKPPTrGt6oYFwppfQjc5EP2sK13Kgl 82YQ== X-Gm-Message-State: AOJu0YxQTbwXNCBMuadlpygzxsRDTtgGVCIm1vmSZ6a/PKxABFPBGd+8 hVH+WEZPV0hSZ/bnM5+RWqO6G5MHxL5gtIaaKUHQBJ6K X-Received: by 2002:a17:90a:c584:b0:26d:d2d:1a90 with SMTP id l4-20020a17090ac58400b0026d0d2d1a90mr2912368pjt.1.1694624947292; Wed, 13 Sep 2023 10:09:07 -0700 (PDT) MIME-Version: 1.0 References: <6db160185d3bd9b3312da4ccc073adcdac58709e.1693328501.git.andreyknvl@google.com> In-Reply-To: From: Andrey Konovalov Date: Wed, 13 Sep 2023 19:08:56 +0200 Message-ID: Subject: Re: [PATCH 11/15] stackdepot: use read/write lock To: Marco Elver Cc: andrey.konovalov@linux.dev, Alexander Potapenko , Dmitry Vyukov , Vlastimil Babka , kasan-dev@googlegroups.com, Evgenii Stepanov , Andrew Morton , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Andrey Konovalov Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Wed, 13 Sep 2023 10:09:51 -0700 (PDT) X-Spam-Status: No, score=-0.6 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email On Tue, Sep 5, 2023 at 6:19=E2=80=AFPM Marco Elver wrote= : > > > Good suggestion. I propose that we keep the rwlock for now, and I'll > > check whether the performance is better with percpu-rwsem once I get > > to implementing and testing the performance changes. I'll also check > > whether percpu-rwsem makes sense for stack ring in tag-based KASAN > > modes. > > I think it's quite obvious that the percpu-rwsem is better. A simple > experiment is to measure the ratio of stackdepot hits vs misses. If > the ratio is obviously skewed towards hits, then I'd just go with the > percpu-rwsem. > > The performance benefit may not be measurable if you use a small system. I started looking into using percpu-rwsem, but it appears that it doesn't have the irqsave/irqrestore API flavor. I suspect that it shouldn't be hard to add it, but I'd rather not pursue this as a part of this series. So I still propose to keep the rwlock for now, and switch to percpu-rwsem later together with the other perf changes.