From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8DFD84508F8 for ; Wed, 15 Jul 2026 17:47:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784137677; cv=none; b=gZaVpkFq11TjNOLpv/HklxUDBzoMl4IUHEusOKhWYpsuUShM6F9LpyVsaOofzBvCbUmPXui4X0uf1gvHcKphPjLU4rHORLbyiHMsS4GNdVysZhllashNTsfKxUQNgDnz1uTZy0xP1JRbJ65TA3KNlWZ6HhxxX2eFbNwyTfEhKV0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784137677; c=relaxed/simple; bh=jBQGUa9FkeSbPCmQl/vIA5rqvoVmYS43WN7j4lW7sj0=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=rBgJ2HVdBBu05DfYQjxdF3fkeYGnq0GcTmzHKoBQ2HgHMUo3ijULEyrU/RJhJ43NkcLruBBV9HkvFeq8WFy+2OEsJtika6pUbN63goyiAz2wPy8m35u+fKRP/aLmiW4Z0wJYl6dQ0JYE+3BlcOgFqhwsT3ZsCzFyxzp/eJFmwhQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=Xmpyl3xV; arc=none smtp.client-ip=170.10.133.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="Xmpyl3xV" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1784137674; 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: in-reply-to:in-reply-to:references:references; bh=SIVygPSmRSWtd96RmEBykYqblePCOKqaKqCbFyUwsMM=; b=Xmpyl3xVOG8JbyfACBS9H0CtQFJobiDBbgyCnSljoU1+3xZRQR4lSVttSVGkElNwr1iEWr SAgxBv369gISXjgP0pbWNNUW3NlNktuxYiOdztppCvrVpUzJjGAkAI8VI03lrB6ONRlCpM V/ZqVdd6XMARkX5pCLSYAsOkg4o91bw= Received: from mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-548-QVSUtwD9MmKUJTfozln6hQ-1; Wed, 15 Jul 2026 13:47:49 -0400 X-MC-Unique: QVSUtwD9MmKUJTfozln6hQ-1 X-Mimecast-MFC-AGG-ID: QVSUtwD9MmKUJTfozln6hQ_1784137667 Received: from mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.93]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id D79CC1955F7D; Wed, 15 Jul 2026 17:47:45 +0000 (UTC) Received: from fedora (unknown [10.44.49.164]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with SMTP id F37061800480; Wed, 15 Jul 2026 17:47:38 +0000 (UTC) Received: by fedora (nbSMTP-1.00) for uid 1000 oleg@redhat.com; Wed, 15 Jul 2026 19:47:45 +0200 (CEST) Date: Wed, 15 Jul 2026 19:47:37 +0200 From: Oleg Nesterov To: Michal Hocko Cc: Richard Chang , Andrew Morton , Kairui Song , Qi Zheng , Shakeel Butt , Barry Song , Axel Rasmussen , Yuanchu Xie , Wei Xu , Johannes Weiner , David Hildenbrand , Lorenzo Stoakes , Suren Baghdasaryan , "T . J . Mercier" , Martin Liu , Minchan Kim , linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2] mm: vmscan: abort proactive reclaim early when freezing for suspend Message-ID: References: <20260709072231.3163082-1-richardycc@google.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=us-ascii Content-Disposition: inline In-Reply-To: X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.93 Hi Michal, On 07/15, Michal Hocko wrote: > > Oleg you haven't been CCed from the top of the thread but TL;DR is that > we need to freeze a user task performing pro-active memory reclaim that > might take long. Currently we are calling signal_pending to bail out > but that leaks EINTR which is bad as freezing task has a side effect of > terminating it. Sorry, I guess I don't understand the problem... Yes, unlike EINTR, ERESTARTSYS should not leak to the caller (just in case, debugger can see this error code). But I am sure you know this. And the patch looks fine to me. Oleg. > > diff --git a/mm/vmscan.c b/mm/vmscan.c > index 35c3bb15ae96..336af76d2a28 100644 > --- a/mm/vmscan.c > +++ b/mm/vmscan.c > @@ -7909,8 +7909,13 @@ int user_proactive_reclaim(char *buf, > unsigned long batch_size = (nr_to_reclaim - nr_reclaimed) / 4; > unsigned long reclaimed; > > + /* > + * Make sure that we enter freezer without delaying much and > + * leaking EINTR when that happens but also take care of > + * fatal signals to terminate. > + */ > if (signal_pending(current)) > - return -EINTR; > + return -ERESTARTSYS; > > /* > * This is the final attempt, drain percpu lru caches in the > -- > Michal Hocko > SUSE Labs >