Received: by 2002:a05:7412:da14:b0:e2:908c:2ebd with SMTP id fe20csp2274044rdb; Mon, 9 Oct 2023 20:58:43 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHEE82v4KEtz1W8ZveBalc+cLQ8A81PQPhO1MrwmPKQEInWewGgXLAnrHipArsWZWvuA6yR X-Received: by 2002:a05:6a00:99b:b0:690:3f29:a874 with SMTP id u27-20020a056a00099b00b006903f29a874mr17037646pfg.23.1696910322819; Mon, 09 Oct 2023 20:58:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696910322; cv=none; d=google.com; s=arc-20160816; b=rtsCeeL9B6nS1hN4AmkaPPXat2hK8HkBCnFFjfiW63NpRsr7EpTGTDxD9M4jVJkloM ZNbb9u1bVl3SfeWGpoQ37Nei3Z/lgFtSL3Y4s2z/uDXagQyGccswLOKOAQhKfL85WUlQ j4I1rh09MtC6bd3q70F0LsKfCxK3+s3crGjssclLchVR1MwLufgRtEo5+AykZ8Pi++i9 DXYJl4Rkqm4JqNKatGw881b8zajZW2ZaJ/1v/Bdvhws74N4M3FghcDgxjCS5Ii8Er6UW s1MLsaCIyGkajU2MD4j2OSkGpI+9hhiBoaAjRDGP+6w0THjI4abbyCUYp6nU9kG9md3Q ONNw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=4gNQmNubIN/TBepTlzBZaBxA4jjJVnAEm3nKv56gu28=; fh=5BclU/P44YEoQpo7zbgr1CJ5+X8jdKZEM+FTvLnCVWs=; b=tanXiwT7sxWzFiNu2hm6AcoUyOXiVa06us5vjtk2A3mosX77PxUKkpOdCJgORCwaa4 GVwzgWZG6iOzQJyqjM65AIX+3/mbpaWs9DNiZTOtmR9X9C3cMGkkFTrNfGbSXlycSWmp phVwMCacyKnxXFB/IWNb0jzzjr533WptQSYz3V6VKvM7wQ3BfysBqkTucr+CxBPk5nvA OWIpC7/6JjXyb/+OlnAxVCwsELhv3D4FcDuRdJY1+k1Pz3GVgiUB/1ohxIzFGdsCcu2K dbyZX/ik9zjHQUhP1nPSV3mdLFpxVj3p0HUl2+/0SOCtWB+L1oXcWStvN6gJuIKD/jaE lKiw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=lI5Bw8KI; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id u13-20020a056a00158d00b00690ff5e479fsi9111986pfk.332.2023.10.09.20.58.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Oct 2023 20:58:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=lI5Bw8KI; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id A7F0380279D7; Mon, 9 Oct 2023 20:58:40 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1442087AbjJJD6Z (ORCPT + 99 others); Mon, 9 Oct 2023 23:58:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37256 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1441973AbjJJD6Y (ORCPT ); Mon, 9 Oct 2023 23:58:24 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8101492; Mon, 9 Oct 2023 20:58:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=4gNQmNubIN/TBepTlzBZaBxA4jjJVnAEm3nKv56gu28=; b=lI5Bw8KIWB5ZsFRFGMi6BGGMWF ZdN2uYMoYxzFmMf154Bbrb6BxetbqIcXc4zdguYF/cYSzs3HUoDfrU0M+yv+RcNJ5vqOIcUirBrxM q5XZKPnayu/uk5a/tHzH0NycAsKNLdQ1rP3yum1YVQWyqK1Dj4cZNxPk0JhLFBDvUxNgLNSlVykLO 6IpsXvyuheU6TLg3ushd2jYq2j7aFASGYPIwNUE2U1/dB2Oc1sgEbXipKii01NjZGUDRxGXKRZYz3 vopBhBePi88Er41e3iXTIJaIElpWZtjDqS5jki8zbB/hAUUF5LAEjPRggq0VjByXxWNsQ1zF62MUS sKBwGsmg==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1qq3sc-002HYA-JP; Tue, 10 Oct 2023 03:57:58 +0000 Date: Tue, 10 Oct 2023 04:57:58 +0100 From: Matthew Wilcox To: Bin Lai Cc: mingo@redhat.com, peterz@infradead.org, juri.lelli@redhat.com, vincent.guittot@linaro.org, akpm@linux-foundation.org, dietmar.eggemann@arm.com, rostedt@goodmis.org, bsegall@google.com, mgorman@suse.de, bristot@redhat.com, vschneid@redhat.com, linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, Bin Lai Subject: Re: [PATCH] sched/wait: introduce endmark in __wake_up_common Message-ID: References: <20231010032833.398033-1-robinlai@tencent.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231010032833.398033-1-robinlai@tencent.com> X-Spam-Status: No, score=2.7 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Mon, 09 Oct 2023 20:58:40 -0700 (PDT) X-Spam-Level: ** On Tue, Oct 10, 2023 at 11:28:33AM +0800, Bin Lai wrote: > Without this patch applied, it can cause the waker to fall into an > infinite loop in some cases. The commit 2554db916586 ("sched/wait: Break > up long wake list walk") introduces WQ_FLAG_BOOKMARK to break up long > wake list walk. When the number of walked entries reach 64, the waker > will record scan position and release the queue lock, which reduces > interrupts and rescheduling latency. Maybe we could try removing bookmarks instead? There was a thread a while ago where we agreed they weren't actually useful any more. Patches to follow ...