Received: by 2002:a05:7412:2a8c:b0:e2:908c:2ebd with SMTP id u12csp85592rdh; Sat, 23 Sep 2023 02:33:15 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEeeq05xWx4NuegjvS4yxDk/E+rHVNdmifOIYuxcIFsAB7s2j9V8vyYt8XLGC7kU/aNDgxw X-Received: by 2002:a17:902:f549:b0:1bc:4f04:17f4 with SMTP id h9-20020a170902f54900b001bc4f0417f4mr6724116plf.30.1695461595651; Sat, 23 Sep 2023 02:33:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695461595; cv=none; d=google.com; s=arc-20160816; b=C88nSpcP+F+JKpJ//4GAeXvkZ/fzB+1sZjAu37w3Ed05NzAkeZEsH5zzjQBLTm78cn mC1d5P50/ZYkDAs5K45vsxR2fcXati5AHkyg9Z6ph284+nSuHxBQdHg5HN4ZqvF2uqzA zIggmHRzG+A2AkS4Y5Ug2ZQG9a8iJG92F+9i+GFQ2UE3adW92Cyo1IKrp+0d/kKwOLlC qjD7lxzDvpY//B5smITrH+Ez1ZswRN3brOlDPs78Wf3AFodncCQCkKpQmbQ5wxUL8TLu 2/Chkge0gMmtxH5+8ysJGQdNWCI3IYIhLEdTELwza/2Rj5YFLmxSTXLna8yQWz1S3vmR QIOg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=sKlrFnpbL0ehwnMZgJkgIQ8qrV6Ye371VmPSQHFlCA8=; fh=JXx1mv1fB650HoTkc5GIgpDQ5Ey550GcDyaNZ/s6bYc=; b=rv3AlrVg85OJTN7sebWPirsIameZ7tnIp7kPJvzYFXpOTGT9hMfZ15KxO0wSy2ogu9 Gpsm05CmtgsQknDmeVmza2GnoqI8jkamWCqcDO6qtVlCtFG16fAoNnPIj7IATNYQWgvj Hq1bxDfQ6w8kfBgpuAQUo+0yxR9H0GbALRWGv3bn/IAd8ZZpul9+w7iHaT/AuVdwsYL5 TipP2SMHcE7bzai3MzLPdeEU5nAInui0RotrZ9WwBSvZnv1j7Dbtnaxt2Pug/sja9ylR z44IlAsA6QFzDjdYNLIHT1R8I7obPOF3Pz7w5ahW+9U3B9ewe8hFRgX+1Og7FuqwyGP9 KuHA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from fry.vger.email (fry.vger.email. [2620:137:e000::3:8]) by mx.google.com with ESMTPS id i11-20020a17090332cb00b001c0a165a219si5783513plr.134.2023.09.23.02.33.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 23 Sep 2023 02:33:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) client-ip=2620:137:e000::3:8; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id 0121D839976A; Sat, 23 Sep 2023 02:32:21 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231255AbjIWJcR (ORCPT + 99 others); Sat, 23 Sep 2023 05:32:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50088 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230523AbjIWJcQ (ORCPT ); Sat, 23 Sep 2023 05:32:16 -0400 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7F863C2; Sat, 23 Sep 2023 02:32:09 -0700 (PDT) Received: from kwepemm000003.china.huawei.com (unknown [172.30.72.55]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4Rt3hz2cCgzNng1; Sat, 23 Sep 2023 17:28:19 +0800 (CST) Received: from ubuntu2204.huawei.com (10.67.174.22) by kwepemm000003.china.huawei.com (7.193.23.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.31; Sat, 23 Sep 2023 17:32:06 +0800 From: Yang Jihong To: , , , , , , , , , , CC: Subject: [PATCH 0/4] perf bench messaging: Kill child processes when exit abnormally in process mode Date: Sat, 23 Sep 2023 09:30:33 +0000 Message-ID: <20230923093037.961232-1-yangjihong1@huawei.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.67.174.22] X-ClientProxiedBy: dggems706-chm.china.huawei.com (10.3.19.183) To kwepemm000003.china.huawei.com (7.193.23.66) X-CFilter-Loop: Reflected X-Spam-Status: No, score=2.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_SBL_CSS,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 fry.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 (fry.vger.email [0.0.0.0]); Sat, 23 Sep 2023 02:32:21 -0700 (PDT) X-Spam-Level: ** If perf bench messaging in process mode exits abnormally, the forked child processes does not exit. The test result is as follows: # perf bench sched messaging -l 1000000 -g 1 & [4] 553 # Running 'sched/messaging' benchmark: # kill -15 533 # ps -ef | grep perf root 425 371 0 09:11 pts/0 00:00:00 perf bench sched messaging -l 1000000 -g 1 root 426 425 17 09:11 pts/0 00:01:56 perf bench sched messaging -l 1000000 -g 1 root 427 425 17 09:11 pts/0 00:01:55 perf bench sched messaging -l 1000000 -g 1 root 428 425 17 09:11 pts/0 00:01:55 perf bench sched messaging -l 1000000 -g 1 root 429 425 17 09:11 pts/0 00:01:55 perf bench sched messaging -l 1000000 -g 1 root 430 425 17 09:11 pts/0 00:01:55 perf bench sched messaging -l 1000000 -g 1 root 431 425 17 09:11 pts/0 00:01:56 perf bench sched messaging -l 1000000 -g 1 root 432 425 17 09:11 pts/0 00:01:55 perf bench sched messaging -l 1000000 -g 1 root 433 425 17 09:11 pts/0 00:01:55 perf bench sched messaging -l 1000000 -g 1 root 434 425 17 09:11 pts/0 00:01:55 perf bench sched messaging -l 1000000 -g 1 root 435 425 17 09:11 pts/0 00:01:55 perf bench sched messaging -l 1000000 -g 1 root 436 425 17 09:11 pts/0 00:01:55 perf bench sched messaging -l 1000000 -g 1 root 437 425 17 09:11 pts/0 00:01:55 perf bench sched messaging -l 1000000 -g 1 root 438 425 17 09:11 pts/0 00:01:55 perf bench sched messaging -l 1000000 -g 1 root 439 425 17 09:11 pts/0 00:01:55 perf bench sched messaging -l 1000000 -g 1 root 440 425 17 09:11 pts/0 00:01:55 perf bench sched messaging -l 1000000 -g 1 root 441 425 17 09:11 pts/0 00:01:55 perf bench sched messaging -l 1000000 -g 1 root 442 425 17 09:11 pts/0 00:01:55 perf bench sched messaging -l 1000000 -g 1 root 443 425 17 09:11 pts/0 00:01:55 perf bench sched messaging -l 1000000 -g 1 root 444 425 17 09:11 pts/0 00:01:54 perf bench sched messaging -l 1000000 -g 1 root 445 425 17 09:11 pts/0 00:01:55 perf bench sched messaging -l 1000000 -g 1 root 446 425 16 09:11 pts/0 00:01:50 perf bench sched messaging -l 1000000 -g 1 root 447 425 16 09:11 pts/0 00:01:49 perf bench sched messaging -l 1000000 -g 1 root 448 425 16 09:11 pts/0 00:01:50 perf bench sched messaging -l 1000000 -g 1 root 449 425 16 09:11 pts/0 00:01:49 perf bench sched messaging -l 1000000 -g 1 root 450 425 16 09:11 pts/0 00:01:50 perf bench sched messaging -l 1000000 -g 1 root 451 425 16 09:11 pts/0 00:01:50 perf bench sched messaging -l 1000000 -g 1 root 452 425 16 09:11 pts/0 00:01:50 perf bench sched messaging -l 1000000 -g 1 root 453 425 16 09:11 pts/0 00:01:49 perf bench sched messaging -l 1000000 -g 1 root 454 425 16 09:11 pts/0 00:01:49 perf bench sched messaging -l 1000000 -g 1 Capture signals SIGINT and SIGTERM to kill child processes in signal handler Yang Jihong (4): perf bench messaging: Fix coding style issues for sched-messaging perf bench messaging: Factor out create_worker() perf bench messaging: Store chlid process pid when creating worker for process mode perf bench messaging: Kill child processes when exit abnormally in process mode tools/perf/bench/sched-messaging.c | 102 ++++++++++++++++++----------- 1 file changed, 64 insertions(+), 38 deletions(-) -- 2.34.1