Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp3415696rdh; Mon, 27 Nov 2023 13:48:32 -0800 (PST) X-Google-Smtp-Source: AGHT+IFpXUL9ouJBhX0v5XCV4BKcQWx4HzR7ZRloK3dsA9T2b5ZNFbOo9t0I9CIEmZt/bOmGrwKJ X-Received: by 2002:a05:6e02:1a64:b0:35d:dcf:e6c4 with SMTP id w4-20020a056e021a6400b0035d0dcfe6c4mr19815ilv.9.1701121712462; Mon, 27 Nov 2023 13:48:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701121712; cv=none; d=google.com; s=arc-20160816; b=cvPS1Uzwl+ECgBvOcqmqKCs3Bl4IZ3McVJ5ujVQCMfc6avIo+1qNaZOCr62Og5a8m1 OmoO6l36CTTA31A0ELbea+58E+g+OwA1ngK7SZSvdNaJoBaauuaHGeYHDIIOZQnqSXBM +UH9O6iXmXk8oiXpjqeEGVX6pNfwgD3Fo47y/p4z6zmArt7JqQDicpvEuLkksOIpFitg 1ZrEcjyj48ChBSD1+C6q61ba5NwFpJCL+rJh/m1M0fDnd+Z4Wsk4BHoRsLWY2nNw8ISE G6qrnOWgothcpH6Zxg0HQmZLVGloMZSUwT8/jEgTTfvY513u+xKSbbbhVFkK/NHaccNH iVww== 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=wKKlccevI+V8zjbSDJyAdH23CW5Jz9/+6agZp8F66zg=; fh=LP9/T8s+eflbOjl+aSlpzMngPDETRTSy0rZyTmhCFj4=; b=sZslbk/U3nNNpqnzZHM5UETaK7eyQoBdpHqTtTK2xqOlb/1DBK03Itz4oN2l2OGfby VGUV+CAk11EDzWVsYAOeEV5HtH0oTDGN6cUf4lP0KPNKXVJRtKPoQ8Sc9hlrfayYHIni TLMSfkxt4UUXwIwE6LLR0jygYbVeSij8FLcgDqJ44eDLW92fu2T5AbR+TTBZvRBNhaxm 5VAUHZXEroDsXjD3bY/RkmUMlbfHTcRs4wo+yQxSZbgbW3W66kKBxpAtxIyBmc+EyDNg WJFmdmsBeqNz/TFiDm2smCZz+pXigoj6lKOXh6QDvw7pWnWu+Q17kw3k8XDaLv9OOX88 Sbtw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=jH5dOasF; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from morse.vger.email (morse.vger.email. [2620:137:e000::3:1]) by mx.google.com with ESMTPS id a11-20020a63d20b000000b005a1d88169casi10138648pgg.189.2023.11.27.13.48.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Nov 2023 13:48:32 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) client-ip=2620:137:e000::3:1; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=jH5dOasF; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id 4A2EE80FE976; Mon, 27 Nov 2023 13:48:30 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233355AbjK0VsK (ORCPT + 99 others); Mon, 27 Nov 2023 16:48:10 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43246 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230330AbjK0VsI (ORCPT ); Mon, 27 Nov 2023 16:48:08 -0500 Received: from mail-ed1-x532.google.com (mail-ed1-x532.google.com [IPv6:2a00:1450:4864:20::532]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0D70DC1 for ; Mon, 27 Nov 2023 13:48:15 -0800 (PST) Received: by mail-ed1-x532.google.com with SMTP id 4fb4d7f45d1cf-5488bf9e193so6551100a12.2 for ; Mon, 27 Nov 2023 13:48:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1701121692; x=1701726492; 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=wKKlccevI+V8zjbSDJyAdH23CW5Jz9/+6agZp8F66zg=; b=jH5dOasFCxL1Ly06bltGrzQc87ISW3s6HTGtWenqJmueaAM0phwUZ/ctDh0S4DvEsh sn0BxRsMVuP3q/eM+70vj7Q9h9BlwTSko2CigYUSkMwKiDhpFqhRHWTYDdOe0iwkziXZ RkGqy3ZEUOueYYyZ1WjidZy2x/8QbZqlKBgAY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701121692; x=1701726492; 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=wKKlccevI+V8zjbSDJyAdH23CW5Jz9/+6agZp8F66zg=; b=F636LcYDtQG9KLGJl9zVe81KAGgrI4mpgMfG53sBz+OwUejIqzE5ujmEpHoxVmaOmZ 8iKKtlqwdcqyb148skXZboTyU8R0YzqI16YotcrLV0H0OIAz38aqmIkKBJDOX7f7qGdN Z0m2qjkkg04Q28oH9YoiuMBMy1LMeA21VAZmgV5v6k1eWzOSlkBE2qKTLMflIfUYI0Uu ZcKnG/zAjGmsn6tkhkPNONOLLJOMBSjdJNh23G1OhvTlMM1W0OSXDQIhuwpUO7xLfI/4 PGkqd78qW0+rgCjWXXr1uPJI/1yS1PrPHnRuN9JXEmXEUjT+afLnKD9+Pc8zEUKUvqZQ b+MA== X-Gm-Message-State: AOJu0Yyaaf+D8aCiNSTHae8ErtBNfZyrXe0Vo9MQwkcJsad/NpW+gFW1 BTMKiWK9LVc0OTdQx8xaZfF4ybmqIoXp942OQZQavA== X-Received: by 2002:a17:906:518e:b0:a12:b06:fa39 with SMTP id y14-20020a170906518e00b00a120b06fa39mr940541ejk.73.1701121691749; Mon, 27 Nov 2023 13:48:11 -0800 (PST) Received: from mail-wm1-f52.google.com (mail-wm1-f52.google.com. [209.85.128.52]) by smtp.gmail.com with ESMTPSA id k18-20020a170906579200b009ffe3e82bbasm6109317ejq.136.2023.11.27.13.48.11 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 27 Nov 2023 13:48:11 -0800 (PST) Received: by mail-wm1-f52.google.com with SMTP id 5b1f17b1804b1-40b367a0a12so2905e9.1 for ; Mon, 27 Nov 2023 13:48:11 -0800 (PST) X-Received: by 2002:a05:600c:3c83:b0:3f4:fb7:48d4 with SMTP id bg3-20020a05600c3c8300b003f40fb748d4mr678223wmb.3.1701121690971; Mon, 27 Nov 2023 13:48:10 -0800 (PST) MIME-Version: 1.0 References: <20231123084022.10302-1-lizhe.67@bytedance.com> In-Reply-To: <20231123084022.10302-1-lizhe.67@bytedance.com> From: Doug Anderson Date: Mon, 27 Nov 2023 13:47:58 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v3] softlockup: serialized softlockup's log To: lizhe.67@bytedance.com Cc: akpm@linux-foundation.org, pmladek@suse.com, lecopzer.chen@mediatek.com, kernelfans@gmail.com, linux-kernel@vger.kernel.org, lizefan.x@bytedance.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.vger.email 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 (morse.vger.email [0.0.0.0]); Mon, 27 Nov 2023 13:48:30 -0800 (PST) Hi, On Thu, Nov 23, 2023 at 12:41=E2=80=AFAM wrote: > > From: Li Zhe > > If multiple CPUs trigger softlockup at the same time with > 'softlockup_all_cpu_backtrace=3D0', the softlockup's logs will appear > staggeredly in dmesg, which will affect the viewing of the logs for > developer. Since the code path for outputting softlockup logs is not > a kernel hotspot and the performance requirements for the code are > not strict, locks are used to serialize the softlockup log output to > improve the readability of the logs. > > Signed-off-by: Li Zhe > --- > Changelogs: > > v1->v2: > - define the lock outside the scope of function > - add precondition 'softlockup_all_cpu_backtrace=3D0' in commit message > > v2->v3: > - define the lock inside the scope of function > > kernel/watchdog.c | 3 +++ > 1 file changed, 3 insertions(+) Reviewed-by: Douglas Anderson