Received: by 2002:a05:7412:da14:b0:e2:908c:2ebd with SMTP id fe20csp2333318rdb; Tue, 10 Oct 2023 00:04:29 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFyIa5dQ70nKlYdnJgxsf5RmklgctgJkjFQxJVHxH8wZ+btxx0DFXA5SuBmg+wEgadnAu4z X-Received: by 2002:a05:6830:1d94:b0:6bf:21d3:2de5 with SMTP id y20-20020a0568301d9400b006bf21d32de5mr17739771oti.17.1696921468752; Tue, 10 Oct 2023 00:04:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696921468; cv=none; d=google.com; s=arc-20160816; b=iFrC8Jeo9t6i1GMYxbjqiI6Z04IU76vj3MxbdARb7Zobs9G/VGu9H01gRrnCVAZarQ MOzHYksBXuI30V7F+EdTtZYKtAsMJQBYUlp1OjxJWDL0WcvgnCeCccU9/3shrbmCqVsy 9k5tFgPWa74Ld8FJAwWbUqS+vnHD/vz7DIxB2lfIm2KTQUAVvrBbPGcWXbqG/BUwI/8Y UwiHy558ZO5Pak0vO/Oih4WinXZH8jCVhwKefPYFhMzHMj4MRfLQ0rteQ1biy8SMySyk F5W64LcT0Y8FLClOJl6yp3TU6TTXs1gLIDaWgVDIZUpnc4yJ0oGmLAYV+vLPLKMXALly ildg== 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=2ALhOBkCqcossn/bCquFde8p2R9AjxMaSkLGBH7l2xU=; fh=ymoPNiwmO0+l7GEiWUdq4v/+4Jyb3Z24yvqhBST9WX0=; b=S+3f98Zf8Cz+1iowobD+mcmhq0qC3yxvkHfSmfoqzI28LoBMUuyK7DdzC7Wge0+kuG 15K/OsglRyhEe5QLzSwDVpu0CB2shyc+eMKIK9EOVzYfgivc5F9UrBTfRSflQK8xfYYR fC6kKtrIA4/p/gbSkggJtyoB0CISGmC1ap7w1nugLfjHpGtMumtVi2xfOkiipkKpHmyR bzlA72D6e/Wu2zPckZskw6MPU2HI7SNEtbGZTkY73PmmirdJoDe33FIvX/TiFz+Hl4d4 qvQQTU8U6Cmnf2a87tdX/Pa8om3bIR5knk5DGTXj2jhk/MrG8mUPKNy6W8nmeyOAqqVj euKw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=gTblv9TR; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from groat.vger.email (groat.vger.email. [23.128.96.35]) by mx.google.com with ESMTPS id u134-20020a63798c000000b00578c9144913si11029772pgc.364.2023.10.10.00.04.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Oct 2023 00:04:28 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) client-ip=23.128.96.35; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=gTblv9TR; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id 5B57C802B160; Tue, 10 Oct 2023 00:04:26 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1442411AbjJJHER (ORCPT + 99 others); Tue, 10 Oct 2023 03:04:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56070 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1377808AbjJJHER (ORCPT ); Tue, 10 Oct 2023 03:04:17 -0400 Received: from mail-yb1-xb36.google.com (mail-yb1-xb36.google.com [IPv6:2607:f8b0:4864:20::b36]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E8E2D99; Tue, 10 Oct 2023 00:04:15 -0700 (PDT) Received: by mail-yb1-xb36.google.com with SMTP id 3f1490d57ef6-d9a3d737d66so1094395276.2; Tue, 10 Oct 2023 00:04:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1696921455; x=1697526255; darn=vger.kernel.org; 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=2ALhOBkCqcossn/bCquFde8p2R9AjxMaSkLGBH7l2xU=; b=gTblv9TRnXR2KT8rbdIizoK69LjR/n4/lA6r7nA29P7QalzWvZmTtJNYIATXVLdO2B 1entQ9vxaLGTQNv69vyfV5DM820q5h1ZnTw+1jJjm4kkw3/MU96i6qbh5ykIePYH1eYT UenFMej1chcBNLklW97OhNExNEP3BTHnUoO/owQhjOs+9N6YJS8BJzM6Yr2Sypwx9P3f aKks3EZ8Gh8wgd701vdwILRkbfi4x0IqV9WywA9tyhq+bkwkm169nR8JmOUYZLfFPsbE /wuN9yLp0/STkpjRRVJcDXu15T8LyJ8wiOVsqo+TjK9/sfa/hK8yiVU5whhop402y/bT vtBw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696921455; x=1697526255; 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=2ALhOBkCqcossn/bCquFde8p2R9AjxMaSkLGBH7l2xU=; b=eMKK5HocKw3j35NzHwv6Zpa/+KtXKqfnzwzH7jpagjxURGL+bjJGSkJfEGnF+lEDrO gw8xUs7WbQuQLWy5nQ0XJq07vZamey0gSHces+po7hG3MluqXY6kzzH6At8AfRxRY2GY N3PYldQDKqDRL5fFVMQELcJgQDybZetdVc6drDl2qMy4IiK9DEeWmqAP2zVe7MQGikuz 6Gkr5OHIWr9i2UgBhq5nkmONE/9U8JrOAB+xRKc64r0TLbJDDt5pIkmiY/4cldeWqFUC /3iBWhlZQm+XL8UrtYEWYHlrqAiB5e0/gPjjFjwvtUWQQ5Qqz73l+VjRazz8Zh86147I G+YQ== X-Gm-Message-State: AOJu0YwB8PCXjGhANkMDrO9PN8OOAb5LVPhlhx8uQvdZ9lET83k0hy4w dXG9rt3DepzRt00Pyy+mFKa07pi75gl+I8c7V7M= X-Received: by 2002:a05:6902:1507:b0:d81:917c:69b with SMTP id q7-20020a056902150700b00d81917c069bmr18771867ybu.10.1696921455072; Tue, 10 Oct 2023 00:04:15 -0700 (PDT) MIME-Version: 1.0 References: <20231010032833.398033-1-robinlai@tencent.com> In-Reply-To: From: lai bin Date: Tue, 10 Oct 2023 15:04:04 +0800 Message-ID: Subject: Re: [PATCH] sched/wait: introduce endmark in __wake_up_common To: Matthew Wilcox 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 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=3.0 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_SBL_CSS, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.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 (groat.vger.email [0.0.0.0]); Tue, 10 Oct 2023 00:04:26 -0700 (PDT) X-Spam-Level: ** Yes, you are right. Now that bookmarks weren't actually useful any more, removing bookmarks is a better way to address the livelocks. Matthew Wilcox =E4=BA=8E2023=E5=B9=B410=E6=9C=8810=E6= =97=A5=E5=91=A8=E4=BA=8C 11:58=E5=86=99=E9=81=93=EF=BC=9A > > 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: Brea= k > > 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 ...