Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp974640rwb; Thu, 22 Sep 2022 08:35:25 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5m7gNShYfwpQ+Bgc0Q1rvZSkIVrmwNV3RRq9nezyriAiQA0GRXBnnp49sOzcDNfPbfyqXH X-Received: by 2002:a17:902:a383:b0:176:dd41:4f56 with SMTP id x3-20020a170902a38300b00176dd414f56mr3919979pla.104.1663860925451; Thu, 22 Sep 2022 08:35:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663860925; cv=none; d=google.com; s=arc-20160816; b=hHKCDPWcbcxRp+TwXlpugn6xMIMxZcTz6g+u4raT2RVvo3oiVIePCKIdsFA2EOuiNu 56bx6AAVdl6g8p/uMVi+Z/znbY2VEVL2c0eN4Mxy11efAwTkwB5uExNrHTURXxBhXGBw b2vHHEiOQYqDcwn17S2GDCyB6NnIm3U6OCB/OpqdLVdh4+KdscT0PvnALpitbMniF0l4 7axnLC9y4N7lRLpqLRpeawlUS0CbP25L5hqJudidoXJNFPhD3n5CwemBCHVJYSNbHlS0 BvVjl5STKSC+4R7PNo2ZGpKYslPGOcbu0JOlFtq2t6FZ/ZrBwF31cjAkQqBXzFg7Zmcd 7whA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=PelATbzyfPdBhYOjywaV0ybFNhVQac/LDmSa6zRJ17Q=; b=FxxlymPPyHE/vXf+28qI/pwszLM9EbZkbgnXhJUJMlfn0n4XHef5RjVPYzJ+tGkmM3 RpjQ5PS0tMR9K3QX/ykUVC5TlkSNw3A4k5H2my83T1gI44K7nEJ2nX4ltnd4dqqeKq7I NVe1ax5g47t626t2mWRtqRU5b64eKkg94d0lBaxb9MGrMPRPFfjdz3+bj/tczCcI6pVz eyewJIJjbcFNJU85RS1T8eXbZ8P60IU2KzMYkmy+dflDKMjInSfGJ99fvBtydKCWmWXk GLv27cgkRqnJICGzv6NiQgRdA2S5zECK/VPCpoHAkPVh0qx+XNsglq3Lj/m8B/XqqJjf 62dw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=hLzss3t6; 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=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id rm7-20020a17090b3ec700b00200a2c60f5csi7209375pjb.133.2022.09.22.08.35.14; Thu, 22 Sep 2022 08:35:25 -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=@redhat.com header.s=mimecast20190719 header.b=hLzss3t6; 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=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231202AbiIVOtI (ORCPT + 99 others); Thu, 22 Sep 2022 10:49:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56806 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229911AbiIVOtF (ORCPT ); Thu, 22 Sep 2022 10:49:05 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 96BDDF6869 for ; Thu, 22 Sep 2022 07:49:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1663858143; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=PelATbzyfPdBhYOjywaV0ybFNhVQac/LDmSa6zRJ17Q=; b=hLzss3t65vnte9yWfWZNyUQMlvhKipMSWBBnVZ5ndTNt7Oe2U3/GBzkUcC1MSGGx4O3TBH q3vGnMCjuJrPF0vTB68HxeDAcKjCevfZ/u9X7l+ZzI32CCsWjTlEavFOkXJbmsRDff6Hgv LMVTUE69m+rR1vCJFJTd4Bt1wQ3PVSA= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-41-BvBq0iVfPfqWn5qszcN6Ow-1; Thu, 22 Sep 2022 10:49:00 -0400 X-MC-Unique: BvBq0iVfPfqWn5qszcN6Ow-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id A7B75858282; Thu, 22 Sep 2022 14:48:59 +0000 (UTC) Received: from [10.22.33.6] (unknown [10.22.33.6]) by smtp.corp.redhat.com (Postfix) with ESMTP id 6A0BE6352E; Thu, 22 Sep 2022 14:48:59 +0000 (UTC) Message-ID: <03d87746-8454-c7eb-6698-af2d02abdc42@redhat.com> Date: Thu, 22 Sep 2022 10:48:59 -0400 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.12.0 Subject: Re: [PATCH v2] tracing: Disable interrupt or preemption before acquiring arch_spinlock_t Content-Language: en-US To: Peter Zijlstra Cc: Ingo Molnar , Will Deacon , Boqun Feng , Steven Rostedt , linux-kernel@vger.kernel.org References: <20220922133158.1731333-1-longman@redhat.com> From: Waiman Long In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 3.1 on 10.11.54.5 X-Spam-Status: No, score=-4.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A, RCVD_IN_DNSWL_LOW,SPF_HELO_NONE,SPF_NONE autolearn=ham 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 On 9/22/22 10:31, Peter Zijlstra wrote: > On Thu, Sep 22, 2022 at 09:31:58AM -0400, Waiman Long wrote: >> It was found that some tracing functions in kernel/trace/trace.c acquire >> an arch_spinlock_t with preemption and irqs enabled. An example is the >> tracing_saved_cmdlines_size_read() function which intermittently causes >> a "BUG: using smp_processor_id() in preemptible" warning when the LTP >> read_all_proc test is run. >> >> That can be problematic in case preemption happens after acquiring the >> lock. Add the necessary preemption or interrupt disabling code in the >> appropriate places before acquiring an arch_spinlock_t. >> >> The convention here is to disable preemption for trace_cmdline_lock and >> interupt for max_lock. >> >> Suggested-by: Steven Rostedt >> Signed-off-by: Waiman Long > This seems to be missing a Fixes: tag :-) Sorry for the omission. The patch should have the following fixes tags. Fixes: a35873a0993b ("tracing: Add conditional snapshot") Fixes: 939c7a4f04fc ("tracing: Introduce saved_cmdlines_size file") Cheers, Longman