From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f43.google.com (mail-wm1-f43.google.com [209.85.128.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7FCC572618 for ; Thu, 16 Jul 2026 08:16:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.43 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784189819; cv=none; b=M4dyMhiKrPKXDVzYvJXoFPkWGSnlO2+AwMtxz02++BpGls2bIAqk/9wuxBOChisCJ2STUk2aWcn55LIYDQNvPvx/b+8bMakv/5em8yFu5hH6NkhEwgrVU5BmNDuzKj5azgrLohvDzrCqGFL8/s8hHVNGXp9m1HQY4EL/dYy79eI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784189819; c=relaxed/simple; bh=+kAkq6JntoT3JvGtVU2avqgQmDWUSXAJn+f5apKJNP8=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=qo6JGgHmI3QilqtuqL96UwBA1PwUwtwgieQheXOxcT3tunBD2STAJdt5dqVXAuQ1m2kxmZIDIS0dMRw78jVxt/JKh+Ll7ECkmoA76LzzwYy+qzVbzFOUS0H2nrZIdc9HebZJt7QOntJ0+Bmz5OdGlz4hCqRVw+Y7iAr6jPWc8HI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com; spf=pass smtp.mailfrom=suse.com; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b=dI3nig6z; arc=none smtp.client-ip=209.85.128.43 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b="dI3nig6z" Received: by mail-wm1-f43.google.com with SMTP id 5b1f17b1804b1-493f2e39e81so24512025e9.2 for ; Thu, 16 Jul 2026 01:16:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1784189816; x=1784794616; darn=vger.kernel.org; h=in-reply-to:content-transfer-encoding:content-disposition :content-type:mime-version:references:message-id:subject:cc:to:from :date:from:to:cc:subject:date:message-id:reply-to:content-type; bh=iCsdFWVbQoyj4moLA5yFZA7Jx6C4owVW5GdKjWE4YMc=; b=dI3nig6z0/q85YxfjHGF8skcx/AV1oRBNLVXnw8uMcFby6VfwmhScGbysuswOoFCTN UTed40H7WnKDBS3fPpyhvV1C40M/fwPCBuV4qGPR5NOTJ8ltO6/zkzfrC4cXU8vMWqhs Jy5QU8+CRt5F8ASebPuVG7hBhCS+lKbi5hHRSXuDMBFsY5YO9yIVnqywwe11I2gUorpk s8q1EKInRk8HUH1owe0LOgzb1mQt0d+RquuB61mDylcw94an/Lfql6rprtR0ThdOZl3d /jb19nEWswP4Q4idPDWdGso1k1L4Sp9pRIYn/Q9X8R++hyLFiVNQsL6tv+YN3wXO81Mj kEuQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1784189816; x=1784794616; h=in-reply-to:content-transfer-encoding:content-disposition :content-type:mime-version:references:message-id:subject:cc:to:from :date:x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to:content-type; bh=iCsdFWVbQoyj4moLA5yFZA7Jx6C4owVW5GdKjWE4YMc=; b=RgwqhPCecrhc1d7woyhqCArr61PVqyrwRoOzqsPchl3YIJN6gbuW0d/OsI6G1b2ZlE oA5cq2PleBEjlFoo5m8zN0vvTdIeO8cAgZTkzty5pNDs+RD2BeAqMHQP0yiofARSo0XG ETQijy0OLhLA2q7hFWN0jWtvrksMrxx2RY5nLlwz1g9Gw0ygsPYNu8KY00DwMTXmrrmp krS3BiW37Sj4WmqpROM3FSHtgFgDMJ0LXdNIJGgEv60c5XpzYOoRzX+KTGU6Vu8X7doP hBTkfsksMuwKMVuC4/cil8aa72Yx9vxfiW3NPJ4ZRwV6P1Vul6OVszkcwkQRg77NNdEL 25zQ== X-Forwarded-Encrypted: i=1; AHgh+RouEFvBmVEGFpBOiqET7L66Ce96Bz6Ta3idV8gcsjkvmzCiN7/bHao7HMwDM2sJzOcMvxTK697jPfpg290=@vger.kernel.org X-Gm-Message-State: AOJu0YxGDUJTa/m/6riVWQS02OcuMaTBDBuHkR1N1zAy5R0esUUP5aR1 rdUaohUQNJ8JoPonKbsGx2ik61X65RnVrpGXQuNFRJCCvl8A21ejiIqEuDzQyYtyqOI= X-Gm-Gg: AfdE7cmLsUGD+21K0F1ZRAdGgc9K5EmjnuZvSvbW8UVfK7zK4Tn2mEKsFfe0E/KtKAZ JW9zIahukIh2snh95Z43Zet6Te+wva7n5Hh9jRxCG9+m6ahGH0f1Oca0sptzCGmkzB43SR9Oq0B Z422eWeoa/U6f/tlVK4Emm5zH70/3hFH/N6pOgQViyGbDPbYSzzneD1xX6+RWZBA6t7FcL7CVNO q/86WhXLiVbfPeeIomFIWSZ9lOCOJ2hohqkQc+HCo8UtYeWklPHhD4dWd6ZNEM74qj1TRcyZ9ry R8AI2DO/4XO+uLHanNo9WYqeI/XlKNU6dPPuisjf6Otul/ui87AGTKQme+B9elAP7J/KT16HeI6 MiVKcYJHsoEp+YCcpG9t13pT2v1hnQ7grwbW61oc6sTwpxxImYqTAaISw2a9Wal+ptGoDWBYqBx VbKAC81s+8VDm9tNY= X-Received: by 2002:a05:600c:a010:b0:493:f73d:cc6d with SMTP id 5b1f17b1804b1-4953c273d53mr63527915e9.24.1784189816551; Thu, 16 Jul 2026 01:16:56 -0700 (PDT) Received: from localhost (109-81-16-227.rct.o2.cz. [109.81.16.227]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-47f4635a9cesm23040548f8f.14.2026.07.16.01.16.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 Jul 2026 01:16:56 -0700 (PDT) Date: Thu, 16 Jul 2026 10:16:55 +0200 From: Michal Hocko To: Altan Hacigumus Cc: Andrew Morton , David Hildenbrand , Johannes Weiner , Kairui Song , Qi Zheng , Shakeel Butt , Barry Song , Axel Rasmussen , Yuanchu Xie , Wei Xu , Lorenzo Stoakes , "Liam R . Howlett" , Vlastimil Babka , Mike Rapoport , Suren Baghdasaryan , Jiayuan Chen , linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] mm/vmscan: clear hopeless kswapd when global direct reclaim makes progress Message-ID: References: <20260710024429.70923-1-ahacigu.linux@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: On Wed 15-07-26 23:20:18, Altan Hacigumus wrote: > On Wed, Jul 15, 2026 at 12:12 AM Michal Hocko wrote: > > > > On Tue 14-07-26 19:32:04, Altan Hacigumus wrote: > > > On Tue, Jul 14, 2026 at 4:34 AM Michal Hocko wrote: > > [...] > > > [2] Also, there is one more condition I've been looking at, from the > > > Sashiko review (a theoretical corner): skip the reset while tasks are > > > throttled on pfmemalloc_wait, so that it cannot defer the hopeless > > > escape hatch in allow_direct_reclaim(). > > > > I would keep this a separate patch with separate reasoning. Ideally with > > some way to trigger the behavior and prove it makes any practical > > meaning. Theoretical corner cases might backfire in this rather > > convoluted area. > > > > Thanks, makes sense - will drop it from this patch. > > Regarding the other suggestion in the Sashiko review, I will keep that > one in: an atomic_read() check before the atomic_xchg(), to avoid taking > the cache line exclusive for already-zero clears in kswapd_clear_hopeless(). While this is generally a good optimization for hot paths and cache hotlines I am not sure this is really the case for kswapd_failures. Perf data might prove me easily wrong... -- Michal Hocko SUSE Labs