Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp12395050rwd; Fri, 23 Jun 2023 05:41:55 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7farI3bEI0Rj68z/yyMDmj/2nMV0MVSowb4GR4OTGCM7IJFqoEmf1psCQT1UkwNFr3KVeK X-Received: by 2002:a05:6358:a19:b0:131:ce9c:9971 with SMTP id 25-20020a0563580a1900b00131ce9c9971mr6636429rwa.29.1687524115379; Fri, 23 Jun 2023 05:41:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687524115; cv=none; d=google.com; s=arc-20160816; b=VFfgHLSr7mdg+HYmc1P8dYWyGjhFKClAi4uWtnCN2jl1A3xMVewJNycSxhova5TfS5 6FR3u4XGk8MESLSYwv4DZEAsnzbwFctOxBSZTYzFr2L1H9AFvfRTIkdjYReV6RzHcMaX e8mpQiv/idipydoa6ciU7jKEMFBFU307ToyUR/8Co3Rdwc0R0o+npegtx2/8Mq5EbyoF Yc3DnR/IAIiGzA19hAd7DqCoQntRqHv6HPNNNl8l1xZOMrOcY4fyjjYNHF57XSoSTRnA WJSl6Oj9XUIAXsUV0m2EOhKDr0sOB52I9YlPF1l7QzYB1Dl/eq5FtGztpjucvj5dbtS3 ur5Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id; bh=xTY89IvjYiblkyrljMZ0XKrAD8caTmh24RYwoPdsR/w=; b=jmoI6W4h1jccKJjQUva9sEo+kTQs4HH24CkhTdWqF7FqpM6TQqJcOiklRvlUTaiFiv RnN4S55x9I2OyTirnbaqNtduepg5KLoefeSBljlU8HjISAvjG89bzQ4/fSecGc2mLRWt j2BypnQWrQq45y1D7v5q784eHUVNMd8lnYczFjrNmoZce4hxoi4t0GRXhueZKxTy6Bvr Ilejxqgpuwo3e/kGLQ10PkaYvqlexwSnQG+lZZTSY2+KWMZX0w9WREgVNd38VpO2RB7F pUX2L9vMILvRS7ogPqdXX/bsdFUwemuHbFZEFDmLtUkEToNiI82PTNqGvRpdCfQr/kK6 8y/A== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 185-20020a6301c2000000b00527d158ec6dsi3512541pgb.406.2023.06.23.05.41.40; Fri, 23 Jun 2023 05:41:55 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230042AbjFWMVZ (ORCPT + 99 others); Fri, 23 Jun 2023 08:21:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49650 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229449AbjFWMVY (ORCPT ); Fri, 23 Jun 2023 08:21:24 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 29EE01BE4 for ; Fri, 23 Jun 2023 05:21:23 -0700 (PDT) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id C94B51042; Fri, 23 Jun 2023 05:22:06 -0700 (PDT) Received: from [192.168.178.6] (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 760B33F59C; Fri, 23 Jun 2023 05:21:19 -0700 (PDT) Message-ID: <509d5ee4-45ec-1279-97da-a308ec7f51aa@arm.com> Date: Fri, 23 Jun 2023 14:21:16 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.11.0 Subject: Re: [PATCH v4 02/13] locking/ww_mutex: Remove wakeups from under mutex::wait_lock Content-Language: en-US To: John Stultz , LKML Cc: Peter Zijlstra , Joel Fernandes , Qais Yousef , Ingo Molnar , Juri Lelli , Vincent Guittot , Valentin Schneider , Steven Rostedt , Ben Segall , Zimuzo Ezeozue , Youssef Esmat , Mel Gorman , Daniel Bristot de Oliveira , Will Deacon , Waiman Long , Boqun Feng , "Paul E . McKenney" , kernel-team@android.com, Connor O'Brien References: <20230601055846.2349566-1-jstultz@google.com> <20230601055846.2349566-3-jstultz@google.com> From: Dietmar Eggemann In-Reply-To: <20230601055846.2349566-3-jstultz@google.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.3 required=5.0 tests=BAYES_00,NICE_REPLY_A, RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE 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 John, On 01/06/2023 07:58, John Stultz wrote: > From: Peter Zijlstra > > In preparation to nest mutex::wait_lock under rq::lock we need to remove > wakeups from under it. [...] > Signed-off-by: Peter Zijlstra (Intel) > Signed-off-by: Connor O'Brien > Signed-off-by: John Stultz > --- > v2: > * Move wake_q_init() as suggested by Waiman Long > --- > include/linux/ww_mutex.h | 3 +++ > kernel/locking/mutex.c | 8 ++++++++ > kernel/locking/ww_mutex.h | 10 ++++++++-- > 3 files changed, 19 insertions(+), 2 deletions(-) > > diff --git a/include/linux/ww_mutex.h b/include/linux/ww_mutex.h > index bb763085479a..9335b2202017 100644 > --- a/include/linux/ww_mutex.h > +++ b/include/linux/ww_mutex.h > @@ -19,6 +19,7 @@ > > #include > #include > +#include > > #if defined(CONFIG_DEBUG_MUTEXES) || \ > (defined(CONFIG_PREEMPT_RT) && defined(CONFIG_DEBUG_RT_MUTEXES)) > @@ -58,6 +59,7 @@ struct ww_acquire_ctx { > unsigned int acquired; > unsigned short wounded; > unsigned short is_wait_die; > + struct wake_q_head wake_q; you told me that there is already an issue in this patch even w/o PE when running `insmod /lib/modules/test-ww_mutex.ko`. The issue is related to Connor's version (1): https://lkml.kernel.org/r/20221003214501.2050087-2-connoro@google.com struct ww_acquire_ctx { struct wake_q_head wake_q; __mutex_lock_common() if (ww_ctx) ww_ctx_wake(ww_ctx) wake_up_q(&ww_ctx->wake_q); wake_q_init(&ww_ctx->wake_q); Juri's version (2): https://lkml.kernel.org/r/20181009092434.26221-3-juri.lelli@redhat.com __mutex_lock_common() DEFINE_WAKE_Q(wake_q) <-- !!! __ww_mutex_check_waiters(..., wake_q) __ww_mutex_die(..., wake_q) wake_q_add(wake_q, waiter->task) wake_up_q(&wake_q) `insmod /lib/modules/test-ww_mutex.ko` runs fine with (2) but not with (1) (both w/o the remaining PE patches). So to test the PE issues we talked about already which come with `[PATCH v4 09/13] sched: Add proxy execution` and CONFIG_PROXY_EXEC=y we need to fix (1) or go back to (2). I haven't found any clues why (2) was changed to (1) so far. [...]