Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp601799ybi; Fri, 7 Jun 2019 13:26:51 -0700 (PDT) X-Google-Smtp-Source: APXvYqw00espbKZanTYqpKr0rbKk6hMHFLWgBU7npIio8nhTbv01bkpIDWW+3mLSjrIGBVExYswJ X-Received: by 2002:a62:fb18:: with SMTP id x24mr60586938pfm.76.1559939211582; Fri, 07 Jun 2019 13:26:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559939211; cv=none; d=google.com; s=arc-20160816; b=KTWU+4NMC0AryXXnwKNeD3UHoW/fmJ5WczdrVJFWrP5iQ+5UqSCB7bEsjzlNeNvoq3 eOzyjvBYJ3uRbpcLsBpjlW2czd61pnSwhh+7nae70mqqkGUTOq3M2oKQajLaZAbjoFP7 aD6AKSfeFfYNRcV1K52HMveBHwZp+mnlZNbUJLQ3Cxdmnm/0+XKVORUdnIzIhaDgkaa6 w9DmkUtnFvlOBUIl54QfFOkM/eIBOl68a6051JpGo3OrX3es5L1/aRxeP0Z8+rqIQl1a UzQ3sC6ZojENa1PUbAqu3ReIvZIr4p4iMEDVnUvWEWXlVSsaqcFOv3kcGaNaQonUj762 6idw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=oUEu5wST+UHrWo914sEu5kjdDbXuNNjK9ZP+p24WTJk=; b=L2a6/ZiXz8W/RSezGfbI1/eQfiR2eHVN0GTQ0KKJ6Y1pkoofUCcpZcNU7NeUrk/bOS BgLMop2+Rqdai1a4jEy3U3GiWVyOF5XrlA999g1ZhU6uKECkcQzTcbEJOV0l/zrTvjBS 5tST2kIUFXdVDtOWr5FU+rOPXQXHvMKlRdyPJgqo75OA2GGzeXDICe+wxO7SvkPolSX/ uMFeuxw4SnH/QtH8PkiPlqNNi9SELCwf7Kh6LZekpg5XKH2UjNKX1fIcQz88KZRtMRzL YAb1ODxzzENQZ7gfCoU7bzaKV54dXPflB8XRG/6pKjyIcihRC34F5HqnBTP8tQwdICrk r9/g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=BCH3+i2R; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j93si3009218plb.32.2019.06.07.13.26.35; Fri, 07 Jun 2019 13:26:51 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=BCH3+i2R; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730373AbfFGUOa (ORCPT + 99 others); Fri, 7 Jun 2019 16:14:30 -0400 Received: from mail-lf1-f65.google.com ([209.85.167.65]:42152 "EHLO mail-lf1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729487AbfFGUO3 (ORCPT ); Fri, 7 Jun 2019 16:14:29 -0400 Received: by mail-lf1-f65.google.com with SMTP id y13so2518832lfh.9 for ; Fri, 07 Jun 2019 13:14:28 -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=oUEu5wST+UHrWo914sEu5kjdDbXuNNjK9ZP+p24WTJk=; b=BCH3+i2RkSQKcHf+jy2IJ/CTFV2fxPDMCV0yygfkoiboPb59bnWZMo807PibOJ2plD Uzjrx+QO3Nq0MQ317FiYIxzStxeM1kuEVYh+K84ZNuWFKtAvM5wPFRvOkAKdLL7zeJ6A bzrmNyaYZqOEIK+oJwa8qi4l+leu534qbZlrw= 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=oUEu5wST+UHrWo914sEu5kjdDbXuNNjK9ZP+p24WTJk=; b=AsxnNkRABDNd7J4xpFADtVYk8XpolGPzi3ibrii3VE0vMi206gAgTYTw4Rrrvqcrif 3Gt2A/GkVXLMxnzRSx/7L7JLfqT3tRhU+xnrEW+V9H3ciavrCxwQMLVAp5I3WPcsS2aU L7CxFG9Xpr3HiHOEq5fpFBbZq6imgC7NWB3bXCodr38KPMJizOWHCthf5St+Tmw6vxip cWK1cWVop/NrPi3NHF6KWc+TMhp00+E5Po1l8K/qrf3/mosLokOYsylDVf53W4d83uES +uTJGygYXv7Pa+vfQ+uQOcFfilcjCIFWGrxHzViSDG3USSs5aWq26HFdTNxR22ycAPUu 8bnA== X-Gm-Message-State: APjAAAWQ44qnX86LS/UTNedJHMNJ2ImfJIrfEYzZyJ7OhVfFqLB5q/ZS Ygb8Mffx9/s2p9tN7n0C+xPl5po4uBM= X-Received: by 2002:a19:740e:: with SMTP id v14mr29096235lfe.144.1559938466755; Fri, 07 Jun 2019 13:14:26 -0700 (PDT) Received: from mail-lj1-f171.google.com (mail-lj1-f171.google.com. [209.85.208.171]) by smtp.gmail.com with ESMTPSA id v12sm521900ljv.49.2019.06.07.13.14.25 for (version=TLS1_3 cipher=AEAD-AES128-GCM-SHA256 bits=128/128); Fri, 07 Jun 2019 13:14:25 -0700 (PDT) Received: by mail-lj1-f171.google.com with SMTP id h11so2823228ljb.2 for ; Fri, 07 Jun 2019 13:14:25 -0700 (PDT) X-Received: by 2002:a2e:6109:: with SMTP id v9mr29356668ljb.205.1559938465306; Fri, 07 Jun 2019 13:14:25 -0700 (PDT) MIME-Version: 1.0 References: <20190605134849.28108-1-jglauber@marvell.com> <20190606080317.GA10606@hc> <20190606094154.GB6795@fuggles.cambridge.arm.com> <20190606102803.GA15499@hc> <20190607072652.GA5522@hc> In-Reply-To: <20190607072652.GA5522@hc> From: Linus Torvalds Date: Fri, 7 Jun 2019 13:14:08 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] lockref: Limit number of cmpxchg loop retries To: Jan Glauber Cc: Will Deacon , Jan Glauber , Linux List Kernel Mailing , Catalin Marinas , Linux ARM , Jayachandran Chandrasekharan Nair Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jun 7, 2019 at 12:27 AM Jan Glauber wrote: > > To clarify, with 224 threads & CPUs queued_spin_lock_slowpath is the top hit > even without a retry limit in lockref. This could be unrelated to the lockref > fallback, it looks like it's coming from the spinlock in: > do_sys_open -> get_unused_fd_flags -> __alloc_fd At some point I stop worrying about microbenchmarks just because it's easy to hit some locking paths in them, without it necessarily being relevant in real loads. But I'll apply the lockref patch because I think the "limit cmpxchg loop" is conceptually a valid model, and while I think the "hitting the same dentry lockref over and over again" is likely also an artifact of a microbenchmark, I could at least imagine that it happens with some common dentries (root, cwd) in some situations. Linus