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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 243C8C433F5 for ; Wed, 5 Oct 2022 11:13:28 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 92F476B0072; Wed, 5 Oct 2022 07:13:27 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 8DE596B0073; Wed, 5 Oct 2022 07:13:27 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 7800A8E0001; Wed, 5 Oct 2022 07:13:27 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id 65AF56B0072 for ; Wed, 5 Oct 2022 07:13:27 -0400 (EDT) Received: from smtpin08.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id 287471C6834 for ; Wed, 5 Oct 2022 11:13:27 +0000 (UTC) X-FDA: 79986634854.08.D4EC60E Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf23.hostedemail.com (Postfix) with ESMTP id C7B46140025 for ; Wed, 5 Oct 2022 11:13:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1664968403; 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: in-reply-to:in-reply-to:references:references; bh=4j6hFk+14cB0RrW5xvRDBfo+I3awEsUnodYOqlNbaXY=; b=MG3WzvHbw+vkpvjA82+6LD84D7ix8Pvo+JBHDBBHWNrLPHDPVpA0etb7f3OBUeHU8WBqtI w5s3WjiRAG/48ELramF1K2dHFspt37pUo0lTrbLWQn53dC2rpb+IC7N3G0oy349NOSz7ex dPmuKyvSoOKIAJ1cF6O3LeC7tleBzvE= Received: from mail-wr1-f70.google.com (mail-wr1-f70.google.com [209.85.221.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-30-sMIk77R-OMqNYg7KXvKWOA-1; Wed, 05 Oct 2022 07:13:20 -0400 X-MC-Unique: sMIk77R-OMqNYg7KXvKWOA-1 Received: by mail-wr1-f70.google.com with SMTP id g27-20020adfa49b000000b0022cd5476cc7so5158776wrb.17 for ; Wed, 05 Oct 2022 04:13:20 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=mime-version:message-id:date:references:in-reply-to:subject:cc:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=4j6hFk+14cB0RrW5xvRDBfo+I3awEsUnodYOqlNbaXY=; b=CKvCnkit6GJJNhpXw4frQnSWxFH6r4hW+0+BL0vDwOGlNEhiTmCyXhuk2RYacShqEx 2QUvgh25ba4XkI9PHj9vOPIS3mnLHU5M/w2EJMEpaE1RUv5cc+whqj2/T5kulhNIW2NM V5gRh8oBlQz+VvkL7lePc1r3GDA0aYmmciYFcNIhL9Dax7LVvA4XwuoKdbE+wuX7cwa4 cIpmkzJXXA3juBWSsDYuFRh6QXND9WPXv7EABGKfYRqknAvKSm+QLFghVideNbLixVrh ryOix/QL+NbSgNdQWpUCXq3hZd8ot7Ky0E0yEDwGhx6RBGS8CKNEKruGu/fvUJFO35RP 5jzw== X-Gm-Message-State: ACrzQf3d8rO21QuTUrwsId5lvutk0QVAHQ/RzxahMhsXiZIsymFt484P X4F8W08VR/X5WeOOG93OgGhaPDhNzJ7aElDw3exjxd3TOqFV7i2QdU7/r/Qf3O/O9axF5XkB0Ct 18/QKlRF4dQg= X-Received: by 2002:a5d:6442:0:b0:22e:2c71:fdac with SMTP id d2-20020a5d6442000000b0022e2c71fdacmr12139398wrw.243.1664968399349; Wed, 05 Oct 2022 04:13:19 -0700 (PDT) X-Google-Smtp-Source: AMsMyM537zceMdjiIGb5BchXxVLco7NaLmYG+9gPd9tisY4R0/U1nN/mGLTijIaXh4JkjVyy0gskjQ== X-Received: by 2002:a5d:6442:0:b0:22e:2c71:fdac with SMTP id d2-20020a5d6442000000b0022e2c71fdacmr12139377wrw.243.1664968399139; Wed, 05 Oct 2022 04:13:19 -0700 (PDT) Received: from vschneid.remote.csb ([149.71.65.94]) by smtp.gmail.com with ESMTPSA id u8-20020a5d5148000000b0022e04bfa661sm13565402wrt.59.2022.10.05.04.13.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Oct 2022 04:13:18 -0700 (PDT) From: Valentin Schneider To: Hillf Danton Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, Lai Jiangshan , Peter Zijlstra , Frederic Weisbecker , Marcelo Tosatti Subject: Re: [PATCH v4 4/4] workqueue: Unbind workers before sending them to exit() In-Reply-To: <20221005010832.1934-1-hdanton@sina.com> References: <20221004150521.822266-1-vschneid@redhat.com> <20221005010832.1934-1-hdanton@sina.com> Date: Wed, 05 Oct 2022 12:13:17 +0100 Message-ID: MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1664968405; h=from:from:sender: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: in-reply-to:in-reply-to:references:references:dkim-signature; bh=4j6hFk+14cB0RrW5xvRDBfo+I3awEsUnodYOqlNbaXY=; b=qUes+eyMmrXO75TbobZaE/1ocgzbXKqQ54XJU0q2JNUG1IZipbQe4enIPDBKvpI0vauQOA WHMQ4Sb5fZKz6j26qkll3BXL1mJBAwmQth3casb13d+44YGK7J7sZJddqEs0uyTjZCtUOY njH6j9NtaTGE+6c1bfMgvOOwHxu/XWs= ARC-Authentication-Results: i=1; imf23.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=MG3WzvHb; spf=pass (imf23.hostedemail.com: domain of vschneid@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=vschneid@redhat.com; dmarc=pass (policy=none) header.from=redhat.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1664968405; a=rsa-sha256; cv=none; b=JpccF7pdX93buwhA6b01zsEq00hHQDO6oqtqAX/yCdP30VpNvb5YnijoOLfjLzitoyYw8/ wpUIPyQkOYVqaVuL6IA03WFo05iFI+W4F/z52Cb1ECiCxRXCMrBUpayk9rN4w6v/N73g6y qS1UqD9FN21TBU3boQ1x5R/0WR/28hM= X-Rspam-User: Authentication-Results: imf23.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=MG3WzvHb; spf=pass (imf23.hostedemail.com: domain of vschneid@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=vschneid@redhat.com; dmarc=pass (policy=none) header.from=redhat.com X-Rspamd-Server: rspam12 X-Rspamd-Queue-Id: C7B46140025 X-Stat-Signature: 7i9m3g5bf6ftwb54jofad975niw7r1dq X-HE-Tag: 1664968405-685584 X-Bogosity: Ham, tests=bogofilter, spamicity=0.040656, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On 05/10/22 09:08, Hillf Danton wrote: > On 4 Oct 2022 16:05:21 +0100 Valentin Schneider >> It has been reported that isolated CPUs can suffer from interference due to >> per-CPU kworkers waking up just to die. >> >> A surge of workqueue activity during initial setup of a latency-sensitive >> application (refresh_vm_stats() being one of the culprits) can cause extra >> per-CPU kworkers to be spawned. Then, said latency-sensitive task can be >> running merrily on an isolated CPU only to be interrupted sometime later by >> a kworker marked for death (cf. IDLE_WORKER_TIMEOUT, 5 minutes after last >> kworker activity). >> > Is tick stopped on the isolated CPU? If tick can hit it then it can accept > more than exiting kworker. >From what I've seen in the scenarios where that happens, yes. The pool->idle_timer gets queued from an isolated CPU and ends up on a housekeeping CPU (cf. get_target_base()). > Another option is exclude isolated CPUs from > active CPUs because workqueue has other works to do than isolating CPUs. > With nohz_full on the cmdline, wq_unbound_cpumask already excludes isolated CPU, but that doesn't apply to per-CPU kworkers. Or did you mean some other mechanism? >> Prevent this by affining kworkers to the wq_unbound_cpumask (which doesn't >> contain isolated CPUs, cf. HK_TYPE_WQ) before waking them up after marking >> them with WORKER_DIE. >>