From patchwork Mon Dec 11 03:52:41 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Liang Chen X-Patchwork-Id: 13486647 X-Patchwork-Delegate: kuba@kernel.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="jEbyzVmX" Received: from mail-yw1-x112f.google.com (mail-yw1-x112f.google.com [IPv6:2607:f8b0:4864:20::112f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D389FF1 for ; Sun, 10 Dec 2023 19:53:21 -0800 (PST) Received: by mail-yw1-x112f.google.com with SMTP id 00721157ae682-5d3d5b10197so32879417b3.2 for ; Sun, 10 Dec 2023 19:53:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1702266801; x=1702871601; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=J730iItaW8fpD9bcYiCc3WSDtwgBtsyA2Jb0R83edv4=; b=jEbyzVmXtx93SPZBlUQnFwIcDofx8tluURMOzs53HtLaF3SzAIZJ4Wym1WEnVIIzXr meAGY0Z06w+H0ehJl/2vMNWrVPtqimvW3ozO4dJVnfvPF6XpmIpmmEfmpg2mPlIkhnSF bXRLILsg4XcVH9EkjJb3X7g6tlzIJZeUkYdoQk+Sxl/soKN71ljBk8rRHXWqFTnPE0o1 hzNjLAEEciA0SZ4Zc3IWTI6u5DQruNxElY9Mr1vykkzA2U38FtSv+kt/l71Ia9IE0jwY exf29mjNmSpRlxcAH3u59+a6gbXElCMFKfm/q0JakptRRNRH5nDHpAX8OqjeKi3aZksJ j4ew== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702266801; x=1702871601; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=J730iItaW8fpD9bcYiCc3WSDtwgBtsyA2Jb0R83edv4=; b=vJvIXCBjz2q8BvRErpk+mIn4L03DabgjXgalQLSxtD4SzYs8ZtCI+g8jkC4Vo6+x0W Va9O3kUm1F5cfxgCXXAswcRswe47mLdCsP3PU7gzQ7/48/gq3vPnUK4qWyyBasfk8fUk r5SZGjVvnKDlRdIqapDIiHU0P/0UJnhFPQ0atUo3r1m6dmcFTtyDpVmiMcfKQHGH+vrP x7tdIqF+iIsPt+M981TAdGW/+qcixRphAY1YjkPjizt/xws0xJraaVsQJsLy2vnRG5w8 bVeAY0+0XTBx/ZxQGejhsjiYKBkpo6dp8LIehk5hbNb9Ve4Vh0bR4l9IZ+R42rKV+VuB TJdA== X-Gm-Message-State: AOJu0YywxVKJDUR2ENxFhSSfTMOzkS5TLSAI8xvWjvp6G/wmoj6iFQ9x eqSfTHlF5+xjKvfL9jP6sZY= X-Google-Smtp-Source: AGHT+IHcK2/Q8KqUlgqgd9YgADevE8eOhbq+FQOnrZxm7i37nZvpcynhBH5Vgt0k8DumJ+fezNSkrA== X-Received: by 2002:a81:8406:0:b0:5d4:2ab1:9f0a with SMTP id u6-20020a818406000000b005d42ab19f0amr2593146ywf.42.1702266800986; Sun, 10 Dec 2023 19:53:20 -0800 (PST) Received: from localhost.localdomain ([89.187.161.180]) by smtp.gmail.com with ESMTPSA id b8-20020a170903228800b001d052d1aaf2sm5411491plh.101.2023.12.10.19.53.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 10 Dec 2023 19:53:20 -0800 (PST) From: Liang Chen To: davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, hawk@kernel.org, ilias.apalodimas@linaro.org, linyunsheng@huawei.com Cc: netdev@vger.kernel.org, linux-mm@kvack.org, jasowang@redhat.com, almasrymina@google.com, liangchen.linux@gmail.com Subject: [PATCH net-next v8 2/4] page_pool: halve BIAS_MAX for multiple user references of a fragment Date: Mon, 11 Dec 2023 11:52:41 +0800 Message-Id: <20231211035243.15774-3-liangchen.linux@gmail.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20231211035243.15774-1-liangchen.linux@gmail.com> References: <20231211035243.15774-1-liangchen.linux@gmail.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Patchwork-Delegate: kuba@kernel.org Referring to patch [1], in order to support multiple users referencing the same fragment and prevent overflow from pp_ref_count growing, the initial value of pp_ref_count is halved, leaving room for pp_ref_count to increment before the page is drained. [1] https://lore.kernel.org/all/20211009093724.10539-3-linyunsheng@huawei.com/ Signed-off-by: Liang Chen Reviewed-by: Yunsheng Lin --- net/core/page_pool.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/core/page_pool.c b/net/core/page_pool.c index 106220b1f89c..436f7ffea7b4 100644 --- a/net/core/page_pool.c +++ b/net/core/page_pool.c @@ -26,7 +26,7 @@ #define DEFER_TIME (msecs_to_jiffies(1000)) #define DEFER_WARN_INTERVAL (60 * HZ) -#define BIAS_MAX LONG_MAX +#define BIAS_MAX (LONG_MAX >> 1) #ifdef CONFIG_PAGE_POOL_STATS /* alloc_stat_inc is intended to be used in softirq context */