From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4F5B4C4345F for ; Tue, 16 Apr 2024 13:11:35 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id CE5B76B0088; Tue, 16 Apr 2024 09:11:34 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id C70AB6B0089; Tue, 16 Apr 2024 09:11:34 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B119E6B008A; Tue, 16 Apr 2024 09:11:34 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id 171C56B0088 for ; Tue, 16 Apr 2024 09:11:34 -0400 (EDT) Received: from smtpin02.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id C30D1A0841 for ; Tue, 16 Apr 2024 13:11:33 +0000 (UTC) X-FDA: 82015431666.02.9BFD5E9 Received: from szxga06-in.huawei.com (szxga06-in.huawei.com [45.249.212.32]) by imf12.hostedemail.com (Postfix) with ESMTP id 898424000B for ; Tue, 16 Apr 2024 13:11:31 +0000 (UTC) Authentication-Results: imf12.hostedemail.com; dkim=none; spf=pass (imf12.hostedemail.com: domain of linyunsheng@huawei.com designates 45.249.212.32 as permitted sender) smtp.mailfrom=linyunsheng@huawei.com; dmarc=pass (policy=quarantine) header.from=huawei.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1713273092; h=from:from:sender: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=nNrhRFVPqmt+dtfbC0KAvyCyYLB+KNobD+Wl5vTWA5U=; b=2wPaZ6JXhEp+ePOSLQrwG/VgbXJQGIJuBJx9XKuwW+MOfMdrLdkE6auB27dEb1/FbaeEzx UJkRhZz7NZszZS+XX0iIm1h1tZlS3dFWnxx5PAJDrTsJLtMqenbW/iHOGxs3gjPwxiLjpY jUSR3eh+AsmkIDW+2JgKUFIzQaaL2FA= ARC-Authentication-Results: i=1; imf12.hostedemail.com; dkim=none; spf=pass (imf12.hostedemail.com: domain of linyunsheng@huawei.com designates 45.249.212.32 as permitted sender) smtp.mailfrom=linyunsheng@huawei.com; dmarc=pass (policy=quarantine) header.from=huawei.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1713273092; a=rsa-sha256; cv=none; b=h58jHKNkH7im+HxVeP4CWvfSxaa3pdvjHZuuO1mCI5b5vA5sK9OmjFGYSdASUyCrno8jZy k8O3dHmEeDFglBEedGYMUQ2mgXodd1WGcwA1heAru2y+bIR7Bb81Lh5vKpofnJd2QHdccV ARnAiRD9Eh9T0RhgC+JXNmeYi7Sa4M4= Received: from mail.maildlp.com (unknown [172.19.162.112]) by szxga06-in.huawei.com (SkyGuard) with ESMTP id 4VJktG0Bmyz17N1f; Tue, 16 Apr 2024 21:10:30 +0800 (CST) Received: from dggpemm500005.china.huawei.com (unknown [7.185.36.74]) by mail.maildlp.com (Postfix) with ESMTPS id 2940C140120; Tue, 16 Apr 2024 21:11:28 +0800 (CST) Received: from [10.69.30.204] (10.69.30.204) by dggpemm500005.china.huawei.com (7.185.36.74) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.35; Tue, 16 Apr 2024 21:11:27 +0800 Subject: Re: [PATCH net-next v2 14/15] mm: page_frag: update documentation for page_frag To: Bagas Sanjaya , , , CC: , , Alexander Duyck , Jonathan Corbet , Andrew Morton , , References: <20240415131941.51153-1-linyunsheng@huawei.com> <20240415131941.51153-15-linyunsheng@huawei.com> From: Yunsheng Lin Message-ID: <483f22fe-1830-8b5c-c32d-9422e356f296@huawei.com> Date: Tue, 16 Apr 2024 21:11:27 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.2.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.69.30.204] X-ClientProxiedBy: dggems706-chm.china.huawei.com (10.3.19.183) To dggpemm500005.china.huawei.com (7.185.36.74) X-Rspamd-Queue-Id: 898424000B X-Rspam-User: X-Stat-Signature: bddqgzhd87gexuk5ftgbbsm7at3y1acy X-Rspamd-Server: rspam01 X-HE-Tag: 1713273091-833702 X-HE-Meta: U2FsdGVkX1/h2WLvmV+C8mg59dtJC84O5twymn1SaSdccn6FWQhzEyR+6c9KtM053oC9sJ4hEb1nhBqyrJ8lZOT/VgeAznxWGlSXlDGY7DZGbpqWMkFU2pZ0msLIriTModr+qla9gHqhgxz9PVPp+QZWIra+HqyWInKauMP6PNVHdhT7hM+2jzxkUiFI49BaPp1a5RY4cyKcdAPeRfkgwxYNpBEwOKkYsHJ2o4icYAWpAYrOJjP/t+osippNA8uzZVg7cKnfm4OmreulDeUlxsDIO7OutVT0kCY28Jgxhsm/zcoRGloDa2cBqPU2/YhFX2AuAPIgLVakBKEdsjG4Y2S0WekdYnv7ASnA8ITWuoYXP0Qwy8qpBVA4a0WMnXSh6KlDsKFJiVZ2esC9hJOGRKdwP15zoMIm2aWMFrc1o+ySW4EPqvPWbtU+suzL5nZIHWsRvXL73DuVVlEw3nEfLBvfgUBVcyQxSUaya76RLnW5+97JFFUzqtpqwscyt32n0nw1b+xL8muXABT3Afe7uaevW2+sOuneV8c1cyJrDxQ/nqjux701Kg3tSz9m1UkwVOHyNuKLoNe4Ru5CAQgjzjVi92FbXVDbvGhshCTlZYMSBG8cf1/9XksintPaxnQ3ngV1VfkkURNFeR43+BZMFvMlVcAXwKiZ1PrTWNrhF/SFy9VxUbwYnujlIQggSZk/5xoqh745IQaxCgdjGZxcx9kWzC4WLZ4fZ2d3wyQKUmR4iVgpXLoWfjkxIrhfQ6rC23EErfgyN9ZZlEmd6eiDsnLtmWxOysvBruRDOeixBT8w73J7v5wq8/l3WDQsc77XUAn7FbeNkFmBwuEwFpskfszqJ3jZ42gHAQRh+DzzniL6UzMRN3vFG6ODomqLuaNuL0ijrh+ey3UWQ/FM7fI+R4vFaAA8KVS5RrKEMMrpOQWOsfCq9CqLU/OVg2YzQoOebO9bjbdZPsV+WAwanrb 60W6UuNM 0RLPdezwEHwzdGsGIQXiG3j8hS068krIYCwHGTKbwDt+/jUJRcgRpLlsm4cgj9VsM8gmEhDAygS7jvJYSfKULAVgCuz+QMsIAz7IsC4RF+L92uPIGxIlvnUZ68bbwDfuECiVohohW/kQOLkLT7AUz6mFdyYAObMVyUiHZLVqTRhNR5W34NuKr9Gv0elVkQcmWT24qZ9QOm8XLZT1ooM5gRo4JPfLmZErS1+djK0kdf2BtGjw49uoKTUxZiw== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: On 2024/4/16 14:13, Bagas Sanjaya wrote: > On Mon, Apr 15, 2024 at 09:19:39PM +0800, Yunsheng Lin wrote: >> +API interface >> +============= >> +As the design and implementation of page_frag API, the allocation side does not > "... implies, the allocation side ..." >> +allow concurrent calling, it is assumed that the caller must ensure there is not > "... . Instead, it is assumed that ...: >> +concurrent alloc calling to the same page_frag_cache instance by using it's own > "... by using its own ..." >> +lock or rely on some lockless guarantee like NAPI softirq. >> + >> +Depending on different use cases, callers expecting to deal with va, page or >> +both va and page for them may call page_frag_alloc_va*, page_frag_alloc_pg*, >> +or page_frag_alloc* API accordingly. >> + >> +There is also a use case that need minimum memory in order for forward >> +progressing, but can do better if there is more memory available. Introduce > Did you mean "... but more performant if more memory is available"? >> +page_frag_alloc_prepare() and page_frag_alloc_commit() related API, the caller > s/Introduce/Using/ >> +requests the minimum memory it need and the prepare API will return the maximum >> +size of the fragment returned, caller need to report back to the page_frag core > "The caller needs to either call the commit API ..." >> +how much memory it actually use by calling commit API, or not calling the commit > "... to report how much memory it actually uses ..." >> +API if deciding to not use any memory. > "... or not do so if deciding to not use any memory." Thanks. Your wording seems better than mine, will update it accordingly. > > Thanks. >