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 54B0CC677F1 for ; Thu, 12 Jan 2023 10:16:03 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id B2CEC8E0002; Thu, 12 Jan 2023 05:16:02 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id ADC6A8E0001; Thu, 12 Jan 2023 05:16:02 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 97D818E0002; Thu, 12 Jan 2023 05:16:02 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id 842488E0001 for ; Thu, 12 Jan 2023 05:16:02 -0500 (EST) Received: from smtpin14.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 509D4C085D for ; Thu, 12 Jan 2023 10:16:02 +0000 (UTC) X-FDA: 80345741364.14.819EE1E Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf20.hostedemail.com (Postfix) with ESMTP id 551FA1C0006 for ; Thu, 12 Jan 2023 10:16:00 +0000 (UTC) Authentication-Results: imf20.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=N6R5bOkE; spf=pass (imf20.hostedemail.com: domain of jbrouer@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=jbrouer@redhat.com; dmarc=pass (policy=none) header.from=redhat.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1673518560; 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:dkim-signature; bh=aMNXrvSE2aga+o/RgOoJzujCgiYF9dT+3d+ZakF9oZs=; b=eZZDIS2nXREBfOSX9NLR7W5pgxM+joySfYBVlYXIxuV1m8hjDa8c5X4dZCJYRObmJ2535w P9ybX6Zo24WpsOfRNXOy3Tbo1g4ss7pbNwKcxslIMbPH3DGthF4qc/iU7kIKXqFFjQNIBx QElTN/GG9tr5q94hvxy5jAEJKPiK5gY= ARC-Authentication-Results: i=1; imf20.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=N6R5bOkE; spf=pass (imf20.hostedemail.com: domain of jbrouer@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=jbrouer@redhat.com; dmarc=pass (policy=none) header.from=redhat.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1673518560; a=rsa-sha256; cv=none; b=CPr81A5JKLrjing6aE0qwaGxP0yWn3/9ulvGJ7cDJQtWelWhOtyn7oqvLbq4/1swy3GISp I9QVHIe/qyirH5a8L6CwiKEO8bNsRZigZj0GjrGEqRCsD/eccObJev5Si6cvUlO8L5n0HE 3sQTxOSCdxMs+MzOkJQxR2SbxYORCHA= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1673518559; 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=aMNXrvSE2aga+o/RgOoJzujCgiYF9dT+3d+ZakF9oZs=; b=N6R5bOkEIG60vaddOfMsLinQ07tap7+MEHWzLl9jHnlOdOWeapAeDhCpIVuVmrIclqOI7/ y8c1dGqG3/lRIL70Hf3mz8JZxXqcuWJ2cxOu4o4nPqUnONVrjnVIwDk4RSbtR2I0uH4xKV yfcMralkbCLZC2xS8XpqviM/MvMK9eg= Received: from mail-ed1-f69.google.com (mail-ed1-f69.google.com [209.85.208.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-228-DQHerFtTN9CIw0jE-T1blA-1; Thu, 12 Jan 2023 05:15:58 -0500 X-MC-Unique: DQHerFtTN9CIw0jE-T1blA-1 Received: by mail-ed1-f69.google.com with SMTP id i8-20020a05640242c800b004852914ce42so11776003edc.6 for ; Thu, 12 Jan 2023 02:15:58 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:references:to :content-language:subject:cc:user-agent:mime-version:date:message-id :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=aMNXrvSE2aga+o/RgOoJzujCgiYF9dT+3d+ZakF9oZs=; b=DyXEGZ0Unxfzz2nJ90oYISMLUU/U2b1sGmdxkyyO5BfhtxE9ic9m8867X7YjjlCU4Z MOA9g08YtkwD/v3ncG8Ezxs2It7DhoLt4fQ+WVG+f6cE6GgqjdhAQ7CxzS3a67Z5XuN9 Hr1qYlqoCq6Cp4ZEFBE1xZm7a2qSUVlIUwdV+8AJKPUrJUrZhaYdJa+ZCpRbxt9sN1AZ GMnHKJ1HY0yfuJvrWR7SdfU9B+zZcN8lrgHGMEKSpj5L58VPFtT8MX7vo9qE/kE7cfCm +jO5ksB6MykpWPIQ5VxUbrZZO3HJLcAUvcBzDG8+4BoLDWbpCoUIFO4zmOy9ZB2j3CW0 16Bw== X-Gm-Message-State: AFqh2kp/h4N44UDDEAvRG+JBZXjdEs8+3bvI+/L8lmvP7UrJGHemP3yG HNVmNZLV6f+3RAwjkjDMzwHUNd06M3+fwkLr1Z28HUCDPeAjGClbOrfmB0d2ib+1DJPgZZ/xawK SnByrHUfYp+0= X-Received: by 2002:a17:906:8506:b0:862:29a8:4f83 with SMTP id i6-20020a170906850600b0086229a84f83mr3993391ejx.44.1673518557484; Thu, 12 Jan 2023 02:15:57 -0800 (PST) X-Google-Smtp-Source: AMrXdXtkcVajjWWSt7t5RB5kVq1DuuoB94cjPwtzhRey2mV8IYVgluqsU4isz9crCYpqj2FXBovy3g== X-Received: by 2002:a17:906:8506:b0:862:29a8:4f83 with SMTP id i6-20020a170906850600b0086229a84f83mr3993374ejx.44.1673518557264; Thu, 12 Jan 2023 02:15:57 -0800 (PST) Received: from [192.168.42.222] (nat-cgn9-185-107-15-52.static.kviknet.net. [185.107.15.52]) by smtp.gmail.com with ESMTPSA id nd38-20020a17090762a600b0084d1b34973dsm7267091ejc.61.2023.01.12.02.15.56 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 12 Jan 2023 02:15:56 -0800 (PST) From: Jesper Dangaard Brouer X-Google-Original-From: Jesper Dangaard Brouer Message-ID: <9cdc89f3-8c00-3673-5fdb-4f5bebd95d7a@redhat.com> Date: Thu, 12 Jan 2023 11:15:55 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.6.0 Cc: brouer@redhat.com, Jesper Dangaard Brouer , Ilias Apalodimas , netdev@vger.kernel.org, linux-mm@kvack.org, Shakeel Butt Subject: Re: [PATCH v3 00/26] Split netmem from struct page To: Matthew Wilcox , Yunsheng Lin References: <20230111042214.907030-1-willy@infradead.org> In-Reply-To: X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 551FA1C0006 X-Stat-Signature: uw883p5zz3h4t33t514gx9bmd4i8jorm X-Rspam-User: X-Rspamd-Server: rspam08 X-HE-Tag: 1673518560-498732 X-HE-Meta: U2FsdGVkX1+oQ1XIbISGP2JWDeTqlgSwlPNEOQUxMOKuOYAAV/1q2aFo9Vf6HBdVZkbfjU8VP8hCfPevf9oIRH29iyZwLu23TLBEdMpD1KXhhBzt7f0e/r38tKczj1FMer2bsyZOzaBx785mJ9fMr3AZR0s6+wbbBHY83gymq8V+KS4zwGabBbgweIzf/l10LK/DILI8sGAtuFYcL4OM0p3KH3hTeQmZMVJfUWZzuHkGyhF0P8ufnJAxgt2BrVtSJ9Tj9iiI9psPVdokJmEUHuwFajJu2BSOsQX9/NLLFgJZYXYLp0eQc133ttv6gFECUDgcYzFGKYlKPWkiNfcKcKXwIbzzIkh/5EY61Y9cwai+dog7cFNXCp8VVdUrwifSW7ar9x0ePRJpvGnPLTAy3ZfcCG7EsPNN4Ub6D3u90uyVrp39pYbA+sSS2mt/e4RiC6ELSxkXKx4+VyUo8eeXplS6ObBUXJE38b1hbxJp53vQKsXE0YKdkTGbOmMqkm8rZzguZWMNRE0NLHZuTaj6JaUrTxlfKVxbTqy1AyQjdSeedpULOsaTY0+jLeRyv56h+kxK+7S/0x6knKnRL74y5qQ/vGDhbdQHaQduohW0FkWepPLyUeXEi/ty3VX84lhp0zpVNngN8i/soJt9z4C5VHKh9gC6P2YVYEzdxlVt0GctL8c18iHk5NwGhuyxtYQ31Dpv3f5d3gbnhOAc2JpI7u9nPRb/ikJvXuOrPlJNnFCDirrEva+MVww9QrWYRPWrwGVZQFfmmXWIDtixTT696kxyQmbDvsvJoBff134Kd3BVfFGtMbDCvqn+Mutmr9jGQ4NrC8G5LcTnd3EMLZ/pJi6e5mw1A6Uip3vZmvfejdR6BOfGarbO+hIP5hG1AjsBohe2OealfUe8gSBZ2dXcVMTCHnOvMSB8MgkDaSmPJrz5gUe4FU6Y3LCV/iPinVI//MG1yfgVff2fFNEaXIG T1EdnyPT QVZxHzbYxr2eD0pet+1Hj2AKtkDhzJkfi4NvambWfmZ/sFCBVLU46qLW8LbWC71iE4zgu0b7YJt+sbBmu1aAUSgLM16vprCVltltBWpibDcdukV8= 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: On 11/01/2023 14.21, Matthew Wilcox wrote: > On Wed, Jan 11, 2023 at 04:25:46PM +0800, Yunsheng Lin wrote: >> On 2023/1/11 12:21, Matthew Wilcox (Oracle) wrote: >>> The MM subsystem is trying to reduce struct page to a single pointer. >>> The first step towards that is splitting struct page by its individual >>> users, as has already been done with folio and slab. This patchset does >>> that for netmem which is used for page pools. >> As page pool is only used for rx side in the net stack depending on the >> driver, a lot more memory for the net stack is from page_frag_alloc_align(), >> kmem cache, etc. >> naming it netmem seems a little overkill, perhaps a more specific name for >> the page pool? such as pp_cache. >> >> @Jesper & Ilias >> Any better idea? I like the 'netmem' name. >> And it seem some API may need changing too, as we are not pooling 'pages' >> now. IMHO it would be overkill to rename the page_pool to e.g. netmem_pool. as it would generate too much churn and will be hard to follow in git as the code filename page_pool.c would also have to be renamed. It guess we keep page_pool for historical reasons ;-) > I raised the question of naming in v1, six weeks ago, and nobody had > any better names. Seems a little unfair to ignore the question at first > and then bring it up now. I'd hate to miss the merge window because of > a late-breaking major request like this. > > https://lore.kernel.org/netdev/20221130220803.3657490-1-willy@infradead.org/ > > I'd like to understand what we think we'll do in networking when we trim > struct page down to a single pointer, All these usages that aren't from > page_pool -- what information does networking need to track per-allocation? > Would it make sense for the netmem to describe all memory used by the > networking stack, and have allocators other than page_pool also return > netmem, This is also how I see the future, that other netstack "allocators" can return and work-with 'netmem' objects. IMHO we are already cramming too many use-cases into page_pool (like the frag support Yunsheng added). IMHO there are room for other netstack "allocators" that can utilize netmem. The page_pool is optimized for RX-NAPI workloads, using it for other purposes is a mistake IMHO. People should create other netstack "allocators" that solves their specific use-cases. E.g. The TX path likely needs another "allocator" optimized for this TX use-case. > or does the normal usage of memory in the net stack not need to > track that information? The page refcnt is (obviously) used by netstack as tracked information. I have seen drivers that use the DMA mapping directly in page/'netmem', instead of having to store this separately in the drivers. --Jesper