Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp1055589rwl; Wed, 29 Mar 2023 12:00:37 -0700 (PDT) X-Google-Smtp-Source: AKy350Y6pCVPKdXfpVbMmEgXmz2cjznEWGcQgqHnLxlhWep+YqPqCOIANa4W/WNupVIhJSmTdNqA X-Received: by 2002:a17:902:da8e:b0:1a1:a273:1812 with SMTP id j14-20020a170902da8e00b001a1a2731812mr26373083plx.45.1680116436835; Wed, 29 Mar 2023 12:00:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680116436; cv=none; d=google.com; s=arc-20160816; b=x+sRK2zZrn4K2T7FC9RWoySXBIw38otqfwPPIu+tPGWWLNhOOigXUVlWV97xHvgfiB hS90fVfXBbMHYHE87ACidcdx9EXExA7NvPvIo9qkY/wJsCye0DumSQyARwDREnMv6mrN FQaTYHrj8nRK4mgcMhy2+M6lZBfOjMnGPBtQ7fRJ9CI3tqK8X3lqdVlpjVlxbKvmPTxt lYfJ+GMJaM2MAfTcNtEg2kSgo6n5T5FEBf+pV3BA42L2f0T4xbEhbX1q7FWuKH6RlCBP +PYSV9SNIfTHJntESylg0Vtgd29VyPPuaGeB7urR3cTHKdQjAQVwI9gQ0SXJeo8wCBSG ocHA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:sender:dkim-signature; bh=Iy+lCmVSfuCqZYe5m364REzCKXPfLlS/vXZ6Sv33Scc=; b=h0ckIsTkqHtxWaO7DLC97s6F0qOlMmSR3nQubpz8AjK+I3LQOHtJrGHzZyP9XHxoAs eLdpgEkjlwO8hT2aJK0E+yp3QwabDQa7zyRV5FOrxXPhMRtDHDp0hbOn14mtcIjPcSAD 6qMWcks4ghFBq0vPEaV5wTFM7w7oW0U8kLeukQ751czSTxv346WtGdBrHf38sUWI29jA iAGahqxAJAHnwRd2Jt8Ewek3Vg4GgQJ8CFe5wpof9fi+8qTNaMQ1vRk94dw8pceJhD36 aAJwLfJhkWQFqSXW71BXDpvwyc9A5wHsdi1STizmL86XM7qwitFZA+hvzJOPDxwAFpGp /WlQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=mOxPMiQc; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id bk13-20020a056a02028d00b0050c0c9d2930si30864095pgb.48.2023.03.29.12.00.24; Wed, 29 Mar 2023 12:00:36 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=mOxPMiQc; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229895AbjC2SxI (ORCPT + 99 others); Wed, 29 Mar 2023 14:53:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55408 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229519AbjC2SxH (ORCPT ); Wed, 29 Mar 2023 14:53:07 -0400 Received: from mail-pj1-x102d.google.com (mail-pj1-x102d.google.com [IPv6:2607:f8b0:4864:20::102d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 26B2559EA; Wed, 29 Mar 2023 11:53:05 -0700 (PDT) Received: by mail-pj1-x102d.google.com with SMTP id om3-20020a17090b3a8300b0023efab0e3bfso19531006pjb.3; Wed, 29 Mar 2023 11:53:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1680115984; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:sender:from:to:cc:subject:date:message-id :reply-to; bh=Iy+lCmVSfuCqZYe5m364REzCKXPfLlS/vXZ6Sv33Scc=; b=mOxPMiQc+w/5rfTRi9mFKJkmmWrWC+fsE86SxcySPbUJ/wuSW6AldTRs3OGXZtwHWv n75hgfb8Jx+JCDbIxrNwCNhfHbchPfWDoQgDmRZL3hRgD1A1QjHOFPi/idbqob30n3+o RfxqdtblWXtXCCQwP77ubsHpTykfAuRiiY2lmCEIRhp/1xZEWZJAWmKKb366YikERsZy b49+3GyAT5iO8CVbUWnbgaKvTSxLC1ZUui2x/A7empu+BSJ09ps4+rHLpazMy4Z/WTbC 7GovkOPkWDIYzMqS73vSWspbX6vZMVT+mWaCOhZRpJ0uPCggyCfuI4KlNvWHIo+z094h 3zKA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680115984; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:sender:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Iy+lCmVSfuCqZYe5m364REzCKXPfLlS/vXZ6Sv33Scc=; b=OiCOgpSwKRPXnJdl/k74jw/fxsccj83OVUE6IQJo/PRmjtvM8A1TE/4K+AUeRYTSHP bOLXbodQmU6ftTXcBddXOMbvoDOkf4TKvEvfKoTG4UXlku4YuQCxFPKpz3yONGrl51+G Y13+4n18kBhl1+Yk8w2GU3bq+rpKoE/46rTRMH+aBkEYG1gxT6YSKofHACELqNt/uKGh uE38U8MKg2ykE67rNoaEs7VLznoXXRz6xYQzZEtsvQY8yggOEn3Eq0kCj7K1fJup+4cG WTIrD7cP+czk1V/wBz33JQ0oEk0H6TcM49sv868pJmriLLXoTao/JToQyJWSpH9shz1b A3tw== X-Gm-Message-State: AAQBX9fM25QTDwrSu5o12/ZWqihxmP0qMNm8oQP1do76wMhqqgMbR/6W 6Nea1e/s61SFZsCVY3CtNQ8= X-Received: by 2002:a17:903:743:b0:1a1:cd69:d301 with SMTP id kl3-20020a170903074300b001a1cd69d301mr17833746plb.68.1680115984286; Wed, 29 Mar 2023 11:53:04 -0700 (PDT) Received: from localhost (2603-800c-1a02-1bae-a7fa-157f-969a-4cde.res6.spectrum.com. [2603:800c:1a02:1bae:a7fa:157f:969a:4cde]) by smtp.gmail.com with ESMTPSA id g6-20020a1709026b4600b001a19cf1b37esm23311756plt.40.2023.03.29.11.53.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Mar 2023 11:53:03 -0700 (PDT) Sender: Tejun Heo Date: Wed, 29 Mar 2023 08:53:02 -1000 From: Tejun Heo To: Yosry Ahmed Cc: Shakeel Butt , Josef Bacik , Jens Axboe , Zefan Li , Johannes Weiner , Michal Hocko , Roman Gushchin , Muchun Song , Andrew Morton , Vasily Averin , cgroups@vger.kernel.org, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, bpf@vger.kernel.org Subject: Re: [RFC PATCH 1/7] cgroup: rstat: only disable interrupts for the percpu lock Message-ID: References: <20230323040037.2389095-1-yosryahmed@google.com> <20230323040037.2389095-2-yosryahmed@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=0.4 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_EF,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello, Yosry. On Mon, Mar 27, 2023 at 04:23:13PM -0700, Yosry Ahmed wrote: > Tejun, if having the lock be non-irq is a non-starter for you, I can This is an actual hazard. We see in prod these unprotected locks causing very big spikes in tail latencies and they can be tricky to root cause too and given the way rstat lock is used it's highly likely to be involved in those scenarios with the proposed change, so it's gonna be a nack from my end. > send a patch that instead gives up the lock and reacquires it at every > CPU boundary unconditionally -- or perhaps every N CPU boundaries to > avoid excessively releasing and reacquiring the lock. I'd just do the simple thing and see whether there's any perf penalty before making it complicated. I'd be pretty surprised if unlocking and relocking the same spinlock adds any noticeable overhead here. Thanks. -- tejun