From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id D9BC5C433F5 for ; Fri, 25 Feb 2022 13:15:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234957AbiBYNQY (ORCPT ); Fri, 25 Feb 2022 08:16:24 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42798 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229974AbiBYNQW (ORCPT ); Fri, 25 Feb 2022 08:16:22 -0500 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A0139181E5A; Fri, 25 Feb 2022 05:15:50 -0800 (PST) Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out2.suse.de (Postfix) with ESMTP id 482B21F380; Fri, 25 Feb 2022 13:15:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1645794949; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=PmNIIM3gpZH3rKjV9RV8YeTjUMiihTOkooMrV/E9GyM=; b=ZSrW6K79vK/zTZhgRs6T7UlP4hs6EUqsHsiSUV/My/ujlxqJ316FZPZVfSn/2Mnqf4GaUM wT5ysHhyfe82zyDrREof/bqZqIM4PWuXHAYmjrRQqwBy2PFrvNMRePKzBEG2uXwyibPu7R UMh+UPy5ffqL0H6S/rd2bXklgMFI368= Received: from suse.cz (unknown [10.100.216.66]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by relay2.suse.de (Postfix) with ESMTPS id A46FFA3B83; Fri, 25 Feb 2022 13:15:48 +0000 (UTC) Date: Fri, 25 Feb 2022 14:15:48 +0100 From: Petr Mladek To: Lecopzer Chen Cc: linux-kernel@vger.kernel.org, Catalin Marinas , Will Deacon , Mark Rutland , Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Alexander Shishkin , Jiri Olsa , Namhyung Kim , davem@davemloft.net, Matthias Brugger , Marc Zyngier , Julien Thierry , Kees Cook , Masahiro Yamada , Andrew Morton , Wang Qing , Luis Chamberlain , Xiaoming Ni , linux-arm-kernel@lists.infradead.org, linux-perf-users@vger.kernel.org, sparclinux@vger.kernel.org, linux-mediatek@lists.infradead.org, sumit.garg@linaro.org, kernelfans@gmail.com, yj.chiang@mediatek.com Subject: Re: [PATCH 3/5] kernel/watchdog_hld: Ensure CPU-bound context when creating hardlockup detector event Message-ID: References: <20220212104349.14266-1-lecopzer.chen@mediatek.com> <20220212104349.14266-4-lecopzer.chen@mediatek.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220212104349.14266-4-lecopzer.chen@mediatek.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat 2022-02-12 18:43:47, Lecopzer Chen wrote: > From: Pingfan Liu > > from: Pingfan Liu > > hardlockup_detector_event_create() should create perf_event on the > current CPU. Preemption could not get disabled because > perf_event_create_kernel_counter() allocates memory. Instead, > the CPU locality is achieved by processing the code in a per-CPU > bound kthread. > > Add a check to prevent mistakes when calling the code in another > code path. > > Signed-off-by: Pingfan Liu > Co-developed-by: Lecopzer Chen > Signed-off-by: Lecopzer Chen Reviewed-by: Petr Mladek Best Regards, Petr From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 102F9C433F5 for ; Fri, 25 Feb 2022 13:16:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=8e7TPT/536Gni9vyg2HEi4i8heCxJKZTLqmItzP+KAE=; b=DZbNTdUQTK9lZk UMbmHIiXHq39+l5jaCahqRi6IjPZZRNUyDp0O/T8NcUPOCp/QjbbqAOxLWCzfy6oNZ14MhI8X6CA1 LzJXfNnRUeTrQAU+XmMtMsdwSmqKjRpF/r1UvoxKWtL2iQ4esFpVkrD5VWRmAIf7z6n/f4SEVzThM URPh+op2EnKqihKZpJS+XRClD76DbZLUmNGu73ZPm8wi9Qyn90h6I6EZRK25uAlmi+eLx/ZAVUrni ijoSHK/ZA5wAcpf2b5c2Uru1wt+5T5PBrzM1Yay9hTeQlNsVYtKnP1P5Vx2l2BoXNv3uBoY1ZngEo y09k4FeRhLKjGMyVpzgg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nNaS7-0051Rb-PI; Fri, 25 Feb 2022 13:16:07 +0000 Received: from smtp-out2.suse.de ([195.135.220.29]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nNaRr-0051K9-Ph; Fri, 25 Feb 2022 13:15:53 +0000 Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out2.suse.de (Postfix) with ESMTP id 482B21F380; Fri, 25 Feb 2022 13:15:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1645794949; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=PmNIIM3gpZH3rKjV9RV8YeTjUMiihTOkooMrV/E9GyM=; b=ZSrW6K79vK/zTZhgRs6T7UlP4hs6EUqsHsiSUV/My/ujlxqJ316FZPZVfSn/2Mnqf4GaUM wT5ysHhyfe82zyDrREof/bqZqIM4PWuXHAYmjrRQqwBy2PFrvNMRePKzBEG2uXwyibPu7R UMh+UPy5ffqL0H6S/rd2bXklgMFI368= Received: from suse.cz (unknown [10.100.216.66]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by relay2.suse.de (Postfix) with ESMTPS id A46FFA3B83; Fri, 25 Feb 2022 13:15:48 +0000 (UTC) Date: Fri, 25 Feb 2022 14:15:48 +0100 From: Petr Mladek To: Lecopzer Chen Cc: linux-kernel@vger.kernel.org, Catalin Marinas , Will Deacon , Mark Rutland , Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Alexander Shishkin , Jiri Olsa , Namhyung Kim , davem@davemloft.net, Matthias Brugger , Marc Zyngier , Julien Thierry , Kees Cook , Masahiro Yamada , Andrew Morton , Wang Qing , Luis Chamberlain , Xiaoming Ni , linux-arm-kernel@lists.infradead.org, linux-perf-users@vger.kernel.org, sparclinux@vger.kernel.org, linux-mediatek@lists.infradead.org, sumit.garg@linaro.org, kernelfans@gmail.com, yj.chiang@mediatek.com Subject: Re: [PATCH 3/5] kernel/watchdog_hld: Ensure CPU-bound context when creating hardlockup detector event Message-ID: References: <20220212104349.14266-1-lecopzer.chen@mediatek.com> <20220212104349.14266-4-lecopzer.chen@mediatek.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20220212104349.14266-4-lecopzer.chen@mediatek.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220225_051552_040204_94C2B910 X-CRM114-Status: GOOD ( 14.12 ) X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.org On Sat 2022-02-12 18:43:47, Lecopzer Chen wrote: > From: Pingfan Liu > > from: Pingfan Liu > > hardlockup_detector_event_create() should create perf_event on the > current CPU. Preemption could not get disabled because > perf_event_create_kernel_counter() allocates memory. Instead, > the CPU locality is achieved by processing the code in a per-CPU > bound kthread. > > Add a check to prevent mistakes when calling the code in another > code path. > > Signed-off-by: Pingfan Liu > Co-developed-by: Lecopzer Chen > Signed-off-by: Lecopzer Chen Reviewed-by: Petr Mladek Best Regards, Petr _______________________________________________ Linux-mediatek mailing list Linux-mediatek@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-mediatek From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id BC021C433F5 for ; Fri, 25 Feb 2022 13:17:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=kwpVpZ8ULRizzeaPo7/gkicAZM7jP5NeDneRGKrHOI4=; b=gU1Lrkc5TI55+G A9hv+mud4Zg7dP7tzP6csdAo8mp2gGMoDwH3MJyxYi977BEh5Tk4RKGsdD2AHyxJQovZ7L9ZswIOb pFZIocwVXlCiQadvzhQLOeQN4L98rw1fXxc1dv7I27a495MRGi6X/6d1FID86dRTk38KEX5bf+Wxk 0vqXHewI0Qkl5ZEf9+Fz0D1nGCJ5+sfR0DPA3xhd/D2OFOi/uE0CcMqK2I0YRzqeBFKBF6aS/JQ2n U6Rq0/QTcaBbcGUv5lkL37saKx69UiqMrCO33dyLXxTiN2A0POQbm66enIVDvMjEtJLkSfvJfJYiH /psRJstSiD/VcaYhc84Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nNaRw-0051N7-R2; Fri, 25 Feb 2022 13:15:57 +0000 Received: from smtp-out2.suse.de ([195.135.220.29]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nNaRr-0051K9-Ph; Fri, 25 Feb 2022 13:15:53 +0000 Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out2.suse.de (Postfix) with ESMTP id 482B21F380; Fri, 25 Feb 2022 13:15:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1645794949; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=PmNIIM3gpZH3rKjV9RV8YeTjUMiihTOkooMrV/E9GyM=; b=ZSrW6K79vK/zTZhgRs6T7UlP4hs6EUqsHsiSUV/My/ujlxqJ316FZPZVfSn/2Mnqf4GaUM wT5ysHhyfe82zyDrREof/bqZqIM4PWuXHAYmjrRQqwBy2PFrvNMRePKzBEG2uXwyibPu7R UMh+UPy5ffqL0H6S/rd2bXklgMFI368= Received: from suse.cz (unknown [10.100.216.66]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by relay2.suse.de (Postfix) with ESMTPS id A46FFA3B83; Fri, 25 Feb 2022 13:15:48 +0000 (UTC) Date: Fri, 25 Feb 2022 14:15:48 +0100 From: Petr Mladek To: Lecopzer Chen Cc: linux-kernel@vger.kernel.org, Catalin Marinas , Will Deacon , Mark Rutland , Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Alexander Shishkin , Jiri Olsa , Namhyung Kim , davem@davemloft.net, Matthias Brugger , Marc Zyngier , Julien Thierry , Kees Cook , Masahiro Yamada , Andrew Morton , Wang Qing , Luis Chamberlain , Xiaoming Ni , linux-arm-kernel@lists.infradead.org, linux-perf-users@vger.kernel.org, sparclinux@vger.kernel.org, linux-mediatek@lists.infradead.org, sumit.garg@linaro.org, kernelfans@gmail.com, yj.chiang@mediatek.com Subject: Re: [PATCH 3/5] kernel/watchdog_hld: Ensure CPU-bound context when creating hardlockup detector event Message-ID: References: <20220212104349.14266-1-lecopzer.chen@mediatek.com> <20220212104349.14266-4-lecopzer.chen@mediatek.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20220212104349.14266-4-lecopzer.chen@mediatek.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220225_051552_040204_94C2B910 X-CRM114-Status: GOOD ( 14.12 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Sat 2022-02-12 18:43:47, Lecopzer Chen wrote: > From: Pingfan Liu > > from: Pingfan Liu > > hardlockup_detector_event_create() should create perf_event on the > current CPU. Preemption could not get disabled because > perf_event_create_kernel_counter() allocates memory. Instead, > the CPU locality is achieved by processing the code in a per-CPU > bound kthread. > > Add a check to prevent mistakes when calling the code in another > code path. > > Signed-off-by: Pingfan Liu > Co-developed-by: Lecopzer Chen > Signed-off-by: Lecopzer Chen Reviewed-by: Petr Mladek Best Regards, Petr _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel