Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp47569rwd; Wed, 14 Jun 2023 12:02:16 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5vG5lwLYC4gg1bxggwrH3buUGb8SmhXpxifo60e38pVRFabZm8GucoW4ro4RBmejfe/38w X-Received: by 2002:a17:906:dac3:b0:96f:9608:da7c with SMTP id xi3-20020a170906dac300b0096f9608da7cmr17764093ejb.36.1686769336185; Wed, 14 Jun 2023 12:02:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686769336; cv=none; d=google.com; s=arc-20160816; b=UV+efJNEyBL7rJF4q1XPxxtBofo5OlMUEZABnWA21F+Lfy4lah83g+0BZ7KUYhV342 l4jy4+NO7f120vBfL2rvd71Z/VxczxgKvB+QZcjuoeWjQBYn6Q/4sbbV/QaRqZNLvsWH Xfa+XJ2J4hYREZ9OtD9b1WuwUzY5XmzHlerDeAWUilnLLy7fzsjqfkUU5kXNrXld0lqG VrG9i3LRpdwSbaq2D/MItpjgtGglpr8Dr16YLCKY/TSml0mOeOGVslPtPnz5yej67+p2 018j0lPEFoct9crXuV1aVWTGylavBmTZiw2gLL4mt8IPZ3hbF+4Kkv4NcxlY2Xdd80nt NWhQ== 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=27Ibbm+oRpNn4LqE//rGeaeQep+ElKzgKjwbwf1dYTI=; b=HDsMFEYCxlfZ0m3yR4EkXaEKvguX9DjaB5MXEOHY4uVUS4SbjKXy4g+1xXdGgWLUsm uDatEDy08HUDrmGBLjGWzmKKrCZeK9Pj1M9/KgXTSNzkbf1igkLNbI7qpVewkKpOZX/C HkMxx4ZGnKgs2YH8/2JEznaSsce2r3WzSR3h1Nl0b+oBDeIfFJgxhZCDthPU11vNjg7t XUSBO03gXqb37qIj+EfbsyNT2+CJkg/kZ+8S8QzQMx2P+LJ1Nu/FqzJgNDJemisz74d6 TkULtkip4oy8JnRKa99gpf6PJUrXkzQhrqhN0raI5TiV8xjx6OJn1xom13BPyZzhAz0H tg5Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20221208 header.b="rlPvuEl/"; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x24-20020a170906711800b00965ff5ddac8si8103693ejj.682.2023.06.14.12.01.43; Wed, 14 Jun 2023 12:02:16 -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=@google.com header.s=20221208 header.b="rlPvuEl/"; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234716AbjFNSuS (ORCPT + 99 others); Wed, 14 Jun 2023 14:50:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34444 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236797AbjFNSuH (ORCPT ); Wed, 14 Jun 2023 14:50:07 -0400 Received: from mail-wr1-x436.google.com (mail-wr1-x436.google.com [IPv6:2a00:1450:4864:20::436]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8425C1BDB for ; Wed, 14 Jun 2023 11:50:06 -0700 (PDT) Received: by mail-wr1-x436.google.com with SMTP id ffacd0b85a97d-310b631c644so1263395f8f.0 for ; Wed, 14 Jun 2023 11:50:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20221208; t=1686768605; x=1689360605; 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=27Ibbm+oRpNn4LqE//rGeaeQep+ElKzgKjwbwf1dYTI=; b=rlPvuEl/jJaiH0rCfqkOGxtRGN0uAw9VtA/vPTQ1mPTbRiF10BXc2h6HoiAr7+1c5D P+bQaqLycMc7aHNQDDnsY+sPC3EqTu2OP57pUnuOo54gx0Ekj04NiU6Psyh6Mlml27GJ u1NuoeypugKiOx4oyOgpe2iFK/vaCl12aNFSsy/7qswrxRzpy5qvxy+H03d9XIOcagsB 9iP02FxwMx57BZiSbCfcEY1k2Lwbr+3bmlwUkJ38Vf3oS1Zt7nMVeOUIQA1RJdwFcDyo u1ndUOcBhF+pcou5sRvQHbZ19EgKHHc2CMGCj3XfBtjzMg9Vq7cgVyhW9OqI5R6jziSg C0TA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686768605; x=1689360605; 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=27Ibbm+oRpNn4LqE//rGeaeQep+ElKzgKjwbwf1dYTI=; b=fcrkbF3a8Mh+C380AX7uQ/gSD6h5LK22OuT8AhICC59DADOeTsKxBxWyTstICc0Eeh 3z08IgwsIzAmpZq9VPwVIZ2HxnS31mo5evYH6hOz7/suFNCUB6odF7k+3plQC9IexlzV R0ErJlAtxcdkvlltzQ3jr4ULktS2u5uVix9nw81EOePU+UF2sZ68min3ZHgDyxo2uXyU 514j+0H/sdhgmv+77YFqYyOrlTkH/Ivb0Zz/6e6tTsuxByewhELCzaJVlYJFN9jVdrNJ KnRu+jQTwgy117NGREiZAZo+2KsxreBaQIitVj6PdXPnoAq2PM0x+CCN5T623Z2VVbk0 7a2g== X-Gm-Message-State: AC+VfDzUxzBszjMvnnRi7Pcmy9YOLmYOW6wB5ZDCoiqgQoLd8u5+4oPF tNwQ4d2F/Wlsi2kEfdnVbq2YvDS3Ci3UJvBjmu4MUg== X-Received: by 2002:adf:dd41:0:b0:30f:c4e2:fc57 with SMTP id u1-20020adfdd41000000b0030fc4e2fc57mr8656969wrm.31.1686768604863; Wed, 14 Jun 2023 11:50:04 -0700 (PDT) MIME-Version: 1.0 References: <20230519001709.2563-1-tj@kernel.org> <20230519001709.2563-15-tj@kernel.org> In-Reply-To: From: Sandeep Dhavale Date: Wed, 14 Jun 2023 11:49:53 -0700 Message-ID: Subject: Re: [PATCH 14/24] workqueue: Generalize unbound CPU pods To: Tejun Heo Cc: jiangshanlai@gmail.com, torvalds@linux-foundation.org, peterz@infradead.org, linux-kernel@vger.kernel.org, kernel-team@meta.com, joshdon@google.com, brho@google.com, briannorris@chromium.org, nhuck@google.com, agk@redhat.com, snitzer@kernel.org, void@manifault.com, kernel-team@android.com, Swapnil Sapkal , kprateek.nayak@amd.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-17.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE,USER_IN_DEF_DKIM_WL,USER_IN_DEF_SPF_WL 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 Hi Tejun, Thank you for your patches! I tested the affinity-scopes-v2 with app launch benchmarks. The numbers below are total scheduling latency for erofs kworke= rs and last column is with percpu highpri kthreads that is CONFIG_EROFS_FS_PCPU_KTHREAD=3Dy CONFIG_EROFS_FS_PCPU_KTHREAD_HIPRI=3Dy Scheduling latency is the latency between when the task became eligible to = run to when it actually started running. The test does 50 cold app launches for= each and aggregates the numbers. | Table | Upstream | Cache nostrict | CPU nostrict | PCPU hpri | |--------------+----------+----------------+--------------+-----------| | Average (us) | 12286 | 7440 | 4435 | 2717 | | Median (us) | 12528 | 3901 | 3258 | 2476 | | Minimum (us) | 287 | 555 | 638 | 357 | | Maximum (us) | 35600 | 35911 | 13364 | 6874 | | Stdev (us) | 7918 | 7503 | 3323 | 1918 | |--------------+----------+----------------+--------------+-----------| We see here that with affinity-scopes-v2 (which defaults to cache nostrict)= , there is a good improvement when compared to the current codebase. Affinity scope "CPU nostrict" for erofs workqueue has even better numbers for my test launches and it resembles logically to percpu highpri kthreads approach. Percpu highpri kthreads has the lowest latency and variation, probably down to running at higher priority as those threads are set to sched_set_fifo_low(). At high level, the app launch numbers itself improved with your series as entire workqueue subsystem improved across the board. Thanks, Sandeep. On Thu, Jun 8, 2023 at 8:43=E2=80=AFPM 'K Prateek Nayak' via kernel-team wrote: > > Hello Tejun, > > On 6/9/2023 4:20 AM, Tejun Heo wrote: > > Hello, > > > > On Thu, Jun 08, 2023 at 08:31:34AM +0530, K Prateek Nayak wrote: > >> [..snip..] > >> o I consistently see a WARN_ON_ONCE() in kick_pool() being hit when I > >> run "sudo ./stress-ng --iomix 96 --timeout 1m". I've seen few > >> different stack traces so far. Including all below just in case: > > ... > >> This is the same WARN_ON_ONCE() you had added in the HEAD commit: > >> > >> $ scripts/faddr2line vmlinux kick_pool+0xdb > >> kick_pool+0xdb/0xe0: > >> kick_pool at kernel/workqueue.c:1130 (discriminator 1) > >> > >> $ sed -n 1130,1132p kernel/workqueue.c > >> if (!WARN_ON_ONCE(wake_cpu >=3D nr_cpu_ids)) > >> p->wake_cpu =3D wake_cpu; > >> get_work_pwq(work)->stats[PWQ_STAT_REPATRIATED]++; > >> > >> Let me know if you need any more data from my test setup. > >> P.S. The kernel is still up and running (~30min) despite hitting this > >> WARN_ON_ONCE() in my case :) > > > > Okay, that was me being stupid and not initializing the new fields for > > per-cpu workqueues. Can you please test the following branch? It should= have > > both bugs fixed properly. > > > > git://git.kernel.org/pub/scm/linux/kernel/git/tj/wq.git affinity-scope= s-v2 > > I've not run into any panics or warnings with this one. Kernel has been > stable for ~30min while running stress-ng iomix. We'll resume the testing > with v2 :) > > > > > If that doesn't crash, I'd love to hear how it affects the perf regress= ions > > reported over that past few months.> > > Thanks. > > > > -- > Thanks and Regards, > Prateek > > -- > To unsubscribe from this group and stop receiving emails from it, send an= email to kernel-team+unsubscribe@android.com. >