From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 D7F2D27183C for ; Wed, 12 Feb 2025 02:46:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739328381; cv=none; b=HNxJ8VOhLMS26pahE67RuC0Dfz+rCsJmL+cT7MySBrER8M5iNX+7/PFwW363E9sIxodft2s8Peo4r29Jh/3wZx6ayIqU2x4LfKLeTj3s1AAqAGPrwb181l6E3nZqXHqpM/OnwgVxGcHQRXHcD58ZT+kwzfkf3Fcl9ZbZfJfIJG0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739328381; c=relaxed/simple; bh=RusHc8Cv8X9pvhBIiUcphMB7CNIxsnoH7Sj7Eg20bzY=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=TXeTeGkAmXFHDek8VYcblv9So1PSGHiKgeUyyziO/y3Xswhl3hmFGPfE//7GwyHW1RRMh88ytnZRjK+WnxYsSLmQglh2ua3QJK8g76w6onSYvlkjjS4UScm/URb042DSjpfQ8lYS2W+L+LnF5uFoIwr1CvlM0Xls9HWaS+LNNaE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Ddn9QZtU; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="Ddn9QZtU" Received: by smtp.kernel.org (Postfix) with ESMTPSA id A440AC4CEDD; Wed, 12 Feb 2025 02:46:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1739328381; bh=RusHc8Cv8X9pvhBIiUcphMB7CNIxsnoH7Sj7Eg20bzY=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=Ddn9QZtUl7Xs6gJ+bcm2oJ6uLz5yfWxg7rI5HmalL+nh8/aNk2AYp0q5jqcZCrFaM WOmHE3bn/cbOAPe25KXF6GoThA2tRw4yO/TuvBbB0xMZK9iBCd+K5YaPggt6T4GMRg Y1YhDxeh4Rc55b8NAjNbPDYrrt8VgRJqAem2l5xA0rvDMNi+MuOay4WCXAOq+YRBLS wfVjQvAi5vFxegt981o1fMBYtXQelVtEW4mw0knQgHv9Z9tu8Z4k2kcKRtzPzlllZ0 zRy/i5TEBzQQ0/X8LXAynCjM35al1gZ02XkKXjxG/kH2JgvmZzTh9wSiVZItAhcu5F 29OPSxD5zd/Xg== Date: Tue, 11 Feb 2025 18:46:19 -0800 From: Jakub Kicinski To: Mina Almasry Cc: Jason Xing , davem@davemloft.net, edumazet@google.com, pabeni@redhat.com, hawk@kernel.org, ilias.apalodimas@linaro.org, horms@kernel.org, netdev@vger.kernel.org Subject: Re: [PATCH net-next v1] page_pool: avoid infinite loop to schedule delayed worker Message-ID: <20250211184619.7d69c99d@kernel.org> In-Reply-To: References: <20250210130953.26831-1-kerneljasonxing@gmail.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Tue, 11 Feb 2025 18:37:22 -0800 Mina Almasry wrote: > Isn't it the condition in page_pool_release_retry() that you want. to > modify? That is the one that handles whether the worker keeps spinning > no? +1 A code comment may be useful BTW. > I also wonder also whether if the check in page_pool_release() itself > needs to be: > > if (inflight < 0) > __page_pool_destroy(); > > otherwise the pool will never be destroyed no? It's probably safer to leak the memory than risk a crash if we undercounted and some page will try to return itself later?