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 CDA6B2DE707 for ; Mon, 11 Aug 2025 09:44:29 +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=1754905471; cv=none; b=SXaA4volLu1pCb78+NzmBXSPUo2Ou0FZN+1e3B4qwfDzCkiIhregpdw7h9mMXfe7HJ6ZJnV8TpdRuNIr+U6X0yjIEWQsYIregoLMBYNOteMsJBEjwqdM9viuaZBJEPTMV6Rpunpv+0U5I2FAUmvDNpauf3z5LxsyZqXLi+zM83o= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1754905471; c=relaxed/simple; bh=/C+FRlGjQPtfUyOjnLRRzxn89zl6SzjGkixLNr8a/bc=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=ThsIyKLFrZt8vnvKBzOLw0lx9t4OMVHYSmWPh5nqS5gYeEhfDUWQrL2RKG7viT8cCx04gJuZ1R3IMGrJmWNmXvMSyjYOBq94KQ4e6M7orVfMSwAITxz/2s6E1yEgytHAeAXlbtwLOqyKkPjZyPHqxvDhZ+w7ba6UiruV8mTkT+E= 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=bea8b8L2; 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="bea8b8L2" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1754905469; 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=aWAq+VNH88+5aD3C80O8tNZjd996k0N5ELPJ0iNyg+I=; b=bea8b8L26z8OhsX2ReRqwKnHBY6zdFCgIW50ivwLYpsQc203Wkp/wSPNVno1RKpoNrBieo yBDnESS+V9kDagij1jj6D7M8/V8XJtTmKPXUQhDXIW/5iSIYtKSuXgmLMoXSsj81VsA6WG DaXOk8qVTdwwgj9fH/kz7yBPhazm/iA= 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-6-kNXTe3OnPpetNzzlStmxMQ-1; Mon, 11 Aug 2025 05:44:25 -0400 X-MC-Unique: kNXTe3OnPpetNzzlStmxMQ-1 X-Mimecast-MFC-AGG-ID: kNXTe3OnPpetNzzlStmxMQ_1754905462 Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.12]) (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 6A061195608F; Mon, 11 Aug 2025 09:44:20 +0000 (UTC) Received: from dhcp-27-174.brq.redhat.com (unknown [10.45.225.234]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with SMTP id 173C519560AD; Mon, 11 Aug 2025 09:44:06 +0000 (UTC) Received: by dhcp-27-174.brq.redhat.com (nbSMTP-1.00) for uid 1000 oleg@redhat.com; Mon, 11 Aug 2025 11:43:08 +0200 (CEST) Date: Mon, 11 Aug 2025 11:42:53 +0200 From: Oleg Nesterov To: Zihuan Zhang Cc: "Rafael J . Wysocki" , Peter Zijlstra , David Hildenbrand , Michal Hocko , Jonathan Corbet , Ingo Molnar , Juri Lelli , Vincent Guittot , Dietmar Eggemann , Steven Rostedt , Ben Segall , Mel Gorman , Valentin Schneider , len brown , pavel machek , Kees Cook , Andrew Morton , Lorenzo Stoakes , "Liam R . Howlett" , Vlastimil Babka , Mike Rapoport , Suren Baghdasaryan , Catalin Marinas , Nico Pache , xu xin , wangfushuai , Andrii Nakryiko , Christian Brauner , Thomas Gleixner , Jeff Layton , Al Viro , Adrian Ratiu , linux-pm@vger.kernel.org, linux-mm@kvack.org, linux-fsdevel@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [RFC PATCH v1 6/9] freezer: Set default freeze priority for zombie tasks Message-ID: <20250811094252.GC11928@redhat.com> References: <20250807121418.139765-1-zhangzihuan@kylinos.cn> <20250807121418.139765-7-zhangzihuan@kylinos.cn> <20250808142948.GA21685@redhat.com> <393a4509-9b05-45b8-8496-699ace9a5438@kylinos.cn> Precedence: bulk X-Mailing-List: linux-fsdevel@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: <393a4509-9b05-45b8-8496-699ace9a5438@kylinos.cn> User-Agent: Mutt/1.5.24 (2015-08-30) X-Scanned-By: MIMEDefang 3.0 on 10.30.177.12 On 08/11, Zihuan Zhang wrote: > > 在 2025/8/8 22:29, Oleg Nesterov 写道: > >On 08/07, Zihuan Zhang wrote: > >>@@ -6980,6 +6981,7 @@ void __noreturn do_task_dead(void) > >> current->flags |= PF_NOFREEZE; > >> > >> __schedule(SM_NONE); > >>+ freeze_set_default_priority(current, FREEZE_PRIORITY_NEVER); > >> BUG(); > >But this change has no effect? > > > >Firstly, this last __schedule() should not return, note the BUG() we have. > > > >Secondly, this zombie is already PF_NOFREEZE, freeze_task() will return > >false anyway. > Sorry, but in our tests with a large number of zombie tasks, returning early > reduced the overhead. Even though freeze_task() would return false for > PF_NOFREEZE, skipping the extra path still saved time in our suspend/freezer https://lore.kernel.org/all/20250707084214.GD1613200@noisy.programming.kicks-ass.net/ Anyway the patch makes no sense in its current form, see my note about __schedule() above. Oleg.