Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp2803132rwd; Fri, 2 Jun 2023 15:13:34 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6jv/YHB2CYqURmQkN4/x0x1jUK5/lS6Vu/ICo5cJvaDR+7j2gYh+nzDPqOoKDhBpUyczxd X-Received: by 2002:a17:902:c2c4:b0:1af:c599:6a88 with SMTP id c4-20020a170902c2c400b001afc5996a88mr859344pla.49.1685744014331; Fri, 02 Jun 2023 15:13:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685744014; cv=none; d=google.com; s=arc-20160816; b=Z/xD80jOJMf77P+aodpWgreYK7i1/YqH4DuDXsKhU5R3I+CB0Kie9e4EsDl38pyZtk lvZEms7osScHcnz1AwUns+SVQ0IGnRQJWJ4kL3YXowL30kGYE/BVQBZO0KKegIo1KV/J gYXKYk/FZb7O+ByiPT0103dJJEU4GIlw1L7J/p4TzMVdCfFNSszfBKgsvkQxncu+LxsH Rtv3PL9j8qH4JFYjJSh/mLEB0rYmgMkzmqR+cLYXGItu1hjWgPT7wdzYm33bYW1kC5eH tnG0C2/dAZboWgZ/8cVRxU9kfjvSCy9Jc4mjlCc+6GP/pYsb0fiSZk5P3rU7FiHmKixq 3YXQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:from:subject:message-id:mime-version:date :dkim-signature; bh=AVjM9PUczt0nDjxkij5BkD4dd+zhr4U2nnWMZn0A5Bw=; b=B+ngHXtdE2TQeDjz2YdyVZd0ppz5pMdnadkRWOLf2jI/WGcuXEikECr7PvSz2r3lEX tUXITqVqhu2bJmqPGSTw3mP5Bhu1aYutjY+WT4xBRuFSlvj2t3lrUH1zfEwAjcXUmVdw cXBxCmRHmr0Y/Jh4r8V4+eaT0UMgXoCQZy/bwoiGTToSFsrp46hkCIEyR1oSSwqeKekC DdHo4aldQBcejU4JsdjDJUxKw/ENqv3/zo06q6DFxuDpjyg+LISwH3et5PFP6R1IPLKE L7Bp43LVMAuhqog7OB4IKGvSOD0qYFfLYegahp5xaVb8N96vKLv14OIV6CtqfNnHzGoD JkZw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20221208 header.b=uBcG8llg; 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 g16-20020a170902869000b001b1ac20dbb1si1459406plo.400.2023.06.02.15.13.22; Fri, 02 Jun 2023 15:13:34 -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=uBcG8llg; 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 S236491AbjFBWCg (ORCPT + 99 others); Fri, 2 Jun 2023 18:02:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54468 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236081AbjFBWCe (ORCPT ); Fri, 2 Jun 2023 18:02:34 -0400 Received: from mail-yw1-x1149.google.com (mail-yw1-x1149.google.com [IPv6:2607:f8b0:4864:20::1149]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3E2BD1BB for ; Fri, 2 Jun 2023 15:02:33 -0700 (PDT) Received: by mail-yw1-x1149.google.com with SMTP id 00721157ae682-5692be06cb2so30399297b3.1 for ; Fri, 02 Jun 2023 15:02:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20221208; t=1685743352; x=1688335352; h=cc:to:from:subject:message-id:mime-version:date:from:to:cc:subject :date:message-id:reply-to; bh=AVjM9PUczt0nDjxkij5BkD4dd+zhr4U2nnWMZn0A5Bw=; b=uBcG8llgLyXLJw3VLTL2Bvns2D7YVia5ndNhO91QH45R2xx9A7wVa7TVzRK04hCFKY YgokuKsEowAw5IW8mQSmHB/Lfm0T4TBvTbjIvN48mtSm4GhFn2hkUtTCM4EJOdqwmbrC eUp+OKo3kgnmm/DvcpebDqUwCsaFoOetIVkso9ewvcq1NSdnfXh/DvvJKJZ/3QN4nbdp qYTqhW5lhY+yoh90KVXZy9EyYTwluoYtjB7nFtqGtH24YIRMLD+CesTo9Scb1qVUAlJ1 gzSKCFVm+64JaSQGP60YFnb5tHWKzMVh1o5nGigrGm5M0Pgn0ICdiBZ5FNAPuPS/5P8O EXxw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685743352; x=1688335352; h=cc:to:from:subject:message-id:mime-version:date:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=AVjM9PUczt0nDjxkij5BkD4dd+zhr4U2nnWMZn0A5Bw=; b=UgSAIyF7EdlN7lIOp/feLGO7I/JgxFU3RnzLm0nZZMLVJM0K/vmW/ZpDiYkOf3mjn1 3EPaHUJa6cat0H67fmKT8mPT0yoIoFXD7WYcjCJ37qKpV8e8fAz98Gorw8Uau02GTJNs MF6XShb3ukIYv9W9xbG46vKn/Q73pkoDap5zYNm5ON/DYgTYIsU7MWDQh8apLi/DPJBw qScNvdAXsorZX0wY82vEnKHjIcbv9oacsNmFrzouz196e8UCnv1XyMOHjejgKpcBEHm9 acXfw3uM5+9YkaANyOfelSaEWwQl1Qukz0m9CvewCzlTtyp3PwpR3QVrTTEYpDHkANrA OB2w== X-Gm-Message-State: AC+VfDzR8uFV+uka4tRxhp8VXThAJcO+Ur5aHA7VFlUXrYkMSl19bHrR veulrJKm8Jfau2CXvfqpwI4F2sBRTD7HZAOeGIZ3X+h1unprmAmmjTHsTlGm0so/2OPBiRuhaDi zrOtCiBiYfN459Hl4HSSCDlxCHNw9jhq8rMqk4cyFKM/W4tJP1xgY0hF+HAVE2gkwmLE5cNo= X-Received: from jstultz-noogler2.c.googlers.com ([fda3:e722:ac3:cc00:24:72f4:c0a8:600]) (user=jstultz job=sendgmr) by 2002:a81:ac06:0:b0:561:8e86:9818 with SMTP id k6-20020a81ac06000000b005618e869818mr540804ywh.7.1685743352408; Fri, 02 Jun 2023 15:02:32 -0700 (PDT) Date: Fri, 2 Jun 2023 22:02:09 +0000 Mime-Version: 1.0 X-Mailer: git-send-email 2.41.0.rc2.161.g9c6817b8e7-goog Message-ID: <20230602220221.600774-1-jstultz@google.com> Subject: [PATCH 1/2] torture: Support randomized shuffling for proxy exec testing From: John Stultz To: LKML Cc: "Connor O'Brien" , Davidlohr Bueso , "Paul E. McKenney" , Josh Triplett , Joel Fernandes , Juri Lelli , Valentin Schneider , Dietmar Eggemann , kernel-team@android.com, John Stultz Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-9.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,USER_IN_DEF_DKIM_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 From: Connor O'Brien Currently shuffling sets the same cpu affinities for all tasks, which makes us less likely to hit paths involving migrating blocked tasks onto a cpu where they can't run. This patch adds an element of randomness to allow affinities of different writer tasks to diverge. This has helped uncover issues in testing with Proxy Execution Cc: Davidlohr Bueso Cc: "Paul E. McKenney" Cc: Josh Triplett Cc: Joel Fernandes Cc: Juri Lelli Cc: Valentin Schneider Cc: Dietmar Eggemann Cc: kernel-team@android.com Signed-off-by: Connor O'Brien Signed-off-by: John Stultz --- kernel/torture.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/kernel/torture.c b/kernel/torture.c index 1a0519b836ac..8be83fdc6be1 100644 --- a/kernel/torture.c +++ b/kernel/torture.c @@ -54,6 +54,9 @@ module_param(verbose_sleep_frequency, int, 0444); static int verbose_sleep_duration = 1; module_param(verbose_sleep_duration, int, 0444); +static int random_shuffle; +module_param(random_shuffle, int, 0444); + static char *torture_type; static int verbose; @@ -518,6 +521,7 @@ static void torture_shuffle_task_unregister_all(void) */ static void torture_shuffle_tasks(void) { + DEFINE_TORTURE_RANDOM(rand); struct shuffle_task *stp; cpumask_setall(shuffle_tmp_mask); @@ -537,8 +541,10 @@ static void torture_shuffle_tasks(void) cpumask_clear_cpu(shuffle_idle_cpu, shuffle_tmp_mask); mutex_lock(&shuffle_task_mutex); - list_for_each_entry(stp, &shuffle_task_list, st_l) - set_cpus_allowed_ptr(stp->st_t, shuffle_tmp_mask); + list_for_each_entry(stp, &shuffle_task_list, st_l) { + if (!random_shuffle || torture_random(&rand) & 0x1) + set_cpus_allowed_ptr(stp->st_t, shuffle_tmp_mask); + } mutex_unlock(&shuffle_task_mutex); cpus_read_unlock(); -- 2.41.0.rc2.161.g9c6817b8e7-goog