Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp5726808rwd; Mon, 12 Jun 2023 08:53:11 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6XrxP0D2rwHCtpOuvrpAQpaIB7CkQ4DKM3LQqUwneq3jkHkSZSJe7CN/KXBewthuwq6XeS X-Received: by 2002:a05:6a00:1396:b0:663:ee11:b1 with SMTP id t22-20020a056a00139600b00663ee1100b1mr9393964pfg.28.1686585191104; Mon, 12 Jun 2023 08:53:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686585191; cv=none; d=google.com; s=arc-20160816; b=NSeOw9O30WoengST5n3X/L82LCQtFWZI1l2oc4TiFVLgwFaAD1113XAtCyO0zl1Bql uBlG2wCRsgMrYUFX1iJKh5IdQmd+90qrLQl9U2ifhzRJQHSSG/so04k86HTuGrz/ltyo i2bJMY4hSLdaWcjMjwJ/UBEIBbqewkzNm2qerCKRbKI4iCjsbQQJOU9CUl/4RAMoWOeU W0lciRg74uy4UOpfurvXvBGGsJmshlYJdUV48cngL3yzs8e5njnSLq9P+DwPgjSDTYfl NSdDz13/tg0ILIG6KxNc7cjT7rciATcSc17Guve4KmrvFIZsDYCQt5yjwHK7rO7eULHw O0XA== 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:references:in-reply-to:subject:cc:to:from :dkim-signature; bh=BX+Ma33nBxxjF/8MZMG5YZCp8D2YlmQXE4UFiVBdJUU=; b=CQGm8eC4gNQTVlb3MQ7+ySvgqlVgcAeAcqOiRF2C8jKZZFgTAa5o8KcSpYPiJntCnd hXx3l/6U7Hs1WFLKmHRP3j39kKXPiTE+W6RlxlaCwEGM4KeSyFGd9mDglZQbaEDC6Ll0 huS7KZGG98zk7+5OqZApAN8d10blgCnoWh5AlbMHVmmCjv6ETbtfvfMD19p8TW9AxW27 4SZgNtp/yblGUg2sHhjWLwO6yL1dfEPcGJCg6eKR6E2oUh7xj5tVWAgyvVj2gjX5hblf MdxBzvtQbtjxG4gfHCfafa2OShjbVPJLSfsyzqesdmEvzIfJIPbZkOF1e9Ljt3qZ5swZ K0jA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="Rq79Z/m7"; 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=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id bv127-20020a632e85000000b005481915c0c7si3165787pgb.32.2023.06.12.08.52.58; Mon, 12 Jun 2023 08:53:11 -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=@redhat.com header.s=mimecast20190719 header.b="Rq79Z/m7"; 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=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232987AbjFLP3V (ORCPT + 99 others); Mon, 12 Jun 2023 11:29:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55550 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232499AbjFLP3R (ORCPT ); Mon, 12 Jun 2023 11:29:17 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0C3D81738 for ; Mon, 12 Jun 2023 08:28:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1686583703; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=BX+Ma33nBxxjF/8MZMG5YZCp8D2YlmQXE4UFiVBdJUU=; b=Rq79Z/m7WAb2+nwcVy5Chj6Om3T8ZCQSnIt7sWJa+48NRTSGZybbA/l1TMoEoN2WcQcUfx 14N0gfm6EBN2FjQNyevvTOuCbYZxP/1uSkKujzmeKUR5x+/adQ5JJp62aoV/lhXJ6OMYy9 W8U5MHxyFVwg97FRiU0kYznXy9KYsDw= Received: from mail-wr1-f71.google.com (mail-wr1-f71.google.com [209.85.221.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-553-KE07oRFdPa6XGwCkuI4eNw-1; Mon, 12 Jun 2023 11:28:19 -0400 X-MC-Unique: KE07oRFdPa6XGwCkuI4eNw-1 Received: by mail-wr1-f71.google.com with SMTP id ffacd0b85a97d-30fc7ab9ff3so231261f8f.0 for ; Mon, 12 Jun 2023 08:28:19 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686583699; x=1689175699; h=content-transfer-encoding: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=BX+Ma33nBxxjF/8MZMG5YZCp8D2YlmQXE4UFiVBdJUU=; b=Y97m1fwKrm7rA2rELEFiSVmSTk7eazkkLZwbbbN2ydS/6zQ2F1BJT+ck5MBtGA8mH0 IzydoYd4YMgiYgVpTtNgr8aFTjZr/KayhAw89TjZioILaAaVCXCKhC8iTTjydDsWohLP StWHil+dOG+X/KkZPVZdWHqWmUOqmpSd+ewam2S3bDcjIlVBcM/nq/g4gdn2lZ4mrGf5 L0Ywo45owzpERpHwsCKuqamT+XOwcO3tZ6G2S+bDmdIjqGv0WXPYfmqMA9r68SOBNn+L UfJmeyHDHnWA74eDwtuF2Ezr1J9f+CSO24FlaKHVdKkbKC5OZ//vaf5Q46+0CQxD+UT+ nmlg== X-Gm-Message-State: AC+VfDwjynNHakfFWtQAuBYI0Wczb4+uGjEbPidsGToXiMj2Cipffxi8 erVPdeDksqcw6DeGJ6L4MBNBCXLummEoN9kjOq9GNnAsHX4NhPLewMepvLs4cpA3nZgOMZnCQQv snuWA16ZG6OlfYrWfsFL+QyqI X-Received: by 2002:adf:d0c1:0:b0:30e:455d:930c with SMTP id z1-20020adfd0c1000000b0030e455d930cmr4700823wrh.6.1686583698835; Mon, 12 Jun 2023 08:28:18 -0700 (PDT) X-Received: by 2002:adf:d0c1:0:b0:30e:455d:930c with SMTP id z1-20020adfd0c1000000b0030e455d930cmr4700811wrh.6.1686583698464; Mon, 12 Jun 2023 08:28:18 -0700 (PDT) Received: from vschneid.remote.csb ([154.57.232.159]) by smtp.gmail.com with ESMTPSA id g26-20020a7bc4da000000b003f60e143d38sm11706261wmk.11.2023.06.12.08.28.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Jun 2023 08:28:18 -0700 (PDT) From: Valentin Schneider To: John Stultz , LKML Cc: Arve =?utf-8?B?SGrDuG5uZXbDpWc=?= , Ingo Molnar , Peter Zijlstra , Juri Lelli , Vincent Guittot , Dietmar Eggemann , Steven Rostedt , Ben Segall , Mel Gorman , Daniel Bristot de Oliveira , android-kernel-team , John Stultz Subject: Re: [RESEND][PATCH v2] sched/wait: Fix a kthread_park race with wait_woken() In-Reply-To: <20230602212350.535358-1-jstultz@google.com> References: <20230602212350.535358-1-jstultz@google.com> Date: Mon, 12 Jun 2023 16:28:07 +0100 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, 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 On 02/06/23 21:23, John Stultz wrote: > From: Arve Hj=C3=B8nnev=C3=A5g > > kthread_park and wait_woken have a similar race that > kthread_stop and wait_woken used to have before it was fixed in > commit cb6538e740d7 ("sched/wait: Fix a kthread race with > wait_woken()"). Extend that fix to also cover kthread_park. > > Cc: Ingo Molnar > Cc: Peter Zijlstra > Cc: Juri Lelli > Cc: Vincent Guittot > Cc: Dietmar Eggemann > Cc: Steven Rostedt > Cc: Ben Segall > Cc: Mel Gorman > Cc: Daniel Bristot de Oliveira > Cc: Valentin Schneider > Cc: android-kernel-team > Signed-off-by: Arve Hj=C3=B8nnev=C3=A5g > [jstultz: Made changes suggested by Peter to optimize > memory loads] > Signed-off-by: John Stultz Funny one, IIUC this will happen with any wakeup of a wait_woken()-user that doesn't touch the wait_queue entry. Reviewed-by: Valentin Schneider I do have on question: what about signals? Browsing through wait_woken() users, it looks like a few of them have a wait-loop break condition hinging on signal_pending() (iio_buffer_read() is one of them). signal_wake_up() doesn't touch the wait_queue entry, so is that a similar issue or am I looking at a non-problem?