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 3E2E8C3DA64 for ; Wed, 31 Jul 2024 18:30:15 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id BAE6B6B0082; Wed, 31 Jul 2024 14:30:14 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id B69056B0083; Wed, 31 Jul 2024 14:30:14 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A4B326B0085; Wed, 31 Jul 2024 14:30:14 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 87F656B0082 for ; Wed, 31 Jul 2024 14:30:14 -0400 (EDT) Received: from smtpin27.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id F0CED12051E for ; Wed, 31 Jul 2024 18:30:13 +0000 (UTC) X-FDA: 82400887506.27.58749C8 Received: from mail-wm1-f51.google.com (mail-wm1-f51.google.com [209.85.128.51]) by imf21.hostedemail.com (Postfix) with ESMTP id 175BE1C0033 for ; Wed, 31 Jul 2024 18:30:11 +0000 (UTC) Authentication-Results: imf21.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=aWjC+oJ6; spf=pass (imf21.hostedemail.com: domain of alexander.duyck@gmail.com designates 209.85.128.51 as permitted sender) smtp.mailfrom=alexander.duyck@gmail.com; dmarc=pass (policy=none) header.from=gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1722450556; 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=xzFKhRbjcnKDzmXujqezge+NtoXFykA/WIDmhHuWCIs=; b=E5xj+c9GvZeg985S/K+bnFKLCNzqLoTYGy8TuOyfYxZeNJZH3+wixOWJl2oHuqejib1eYP nB9Jal2HEw7Iom7XppNj1uY4jvBgaFN4pclw/tpSHVDLw5dlFadhDUTwUuNxYUbwy8NlEf qhtxtLtPwYFXYTP2O7ACSUGodI0dzYY= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1722450556; a=rsa-sha256; cv=none; b=YgidC4234yRh3x8c/0hhI8P+oD/UCqWTtumHaJPFKm+g9K3PmumLJ1Nh2aClM+RJDWJ9Mi Gr8+0EVmEIU392C9gFGo3H9kDVldXpoOqsS93YbCAhTB5jNpPeVAfyhqQJY93eSwD65W9X fOIfgGCRuO9rgoV8M4jN00UBNQXgHKQ= ARC-Authentication-Results: i=1; imf21.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=aWjC+oJ6; spf=pass (imf21.hostedemail.com: domain of alexander.duyck@gmail.com designates 209.85.128.51 as permitted sender) smtp.mailfrom=alexander.duyck@gmail.com; dmarc=pass (policy=none) header.from=gmail.com Received: by mail-wm1-f51.google.com with SMTP id 5b1f17b1804b1-426526d30aaso40198915e9.0 for ; Wed, 31 Jul 2024 11:30:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1722450610; x=1723055410; darn=kvack.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=xzFKhRbjcnKDzmXujqezge+NtoXFykA/WIDmhHuWCIs=; b=aWjC+oJ6eSRbUdKklnoQQQyoKSuxYYo5rYnToCa1d3f0EReEnxCVM3tr7VBxnEYamd +6tl8o2iN6Ji3AkwtoQraaXS6oyYNAcDWkq5XmQX3xom3PEPim82ZQKPK+GoHsSn9wa7 1MvzzU2FoGR0TIe0DZPX9GeVpu5gChlZIBckJw+2dwjAahxW5wEwpesaFuhFftToJCj1 hUy7WOs94reKkRzW7d9A5gt+7wQCpxrZqAE345LyaZdRr8W+fsESJCxd4ExPUQid5F/2 imqEvKtRjXNFihedj0GSDRBvW5FdjKy6xAgVAabwi2AIvi0wLomAJDulRPSlWAJR+mJ1 dj+g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1722450610; x=1723055410; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=xzFKhRbjcnKDzmXujqezge+NtoXFykA/WIDmhHuWCIs=; b=bQ5DCatqdz4hClpPMZ4/2AxVbvYiY7h4eJyJGC0m0hEzDMZBqnjnY7MPgFJXihDi0p KVIe5QCLlPb7eFwieTwf8/3lnUf27Epsgvfp8NZU+/faY5s2Hu3XUds0ZQ3293ri5qfj o8AWVWOSRI8UBO4pKQWVYmqQsGYhCCzolG5Zd3qd37gO2LsmYfsU7Ldz7jC0RdnFEHfK F2Gf4KbWTrt/kKfMdyqeKmutm7HmzHfd4JC7spLLMLbp26pe7uqaP9fZsgCss6bVZOnL aFa7ADmUyn/xcvLIOrpLToUUtDTPUZOJOPwk3KkBAcdGEWJB+B0zi3QPr2g3W/gVd60X gupw== X-Forwarded-Encrypted: i=1; AJvYcCXfAADaQ3sy11SJ+2W+ex7B9Pz4rl+sIkqj6ROF3yi12Yn4TbtK+F51JC1MoQJ64h2ym3qBnJOZRQ==@kvack.org X-Gm-Message-State: AOJu0YwO+94x/p2VfSyY7GXKVOkFS8wTx0jfQgteQAoxLh1p64i84W+u t0r05H9OezbzHfPQZo2j933bfmYvN9Ceuc7Mv/mczXx85tdkPNGEucgaa0iVCLpZsYY+l5SUQiE f62j15LlgEWDVzeBUP33Lg7+XKD8= X-Google-Smtp-Source: AGHT+IH+al8QxOSqxSgNhgRT8STt0ekdoEAUUJ1Wlbp5jr9AL/AtJiPkqmwH128b1nAkyeI5YJI1pCz+mf1pT0GrpO4= X-Received: by 2002:a5d:6a09:0:b0:368:7fbc:4062 with SMTP id ffacd0b85a97d-36baadee061mr96135f8f.33.1722450610095; Wed, 31 Jul 2024 11:30:10 -0700 (PDT) MIME-Version: 1.0 References: <20240731124505.2903877-1-linyunsheng@huawei.com> <20240731124505.2903877-2-linyunsheng@huawei.com> In-Reply-To: <20240731124505.2903877-2-linyunsheng@huawei.com> From: Alexander Duyck Date: Wed, 31 Jul 2024 11:29:33 -0700 Message-ID: Subject: Re: [PATCH net-next v12 01/14] mm: page_frag: add a test module for page_frag To: Yunsheng Lin Cc: davem@davemloft.net, kuba@kernel.org, pabeni@redhat.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Andrew Morton , linux-mm@kvack.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Rspam-User: X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: 175BE1C0033 X-Stat-Signature: ts1h7dmnhamcbeksb79nq8os8sg6bxad X-HE-Tag: 1722450611-564795 X-HE-Meta: U2FsdGVkX1+MYPu7TU0nO1NecRjwW3MbTuDLipJHlxgfRTIBDkE5prp1S6PMr5Bq6PNrh0ghRE+Y1M3Tm2vVmRxEYsQ8FDh3ScvadyE7IF9+2FRyoYfkfoFBXAn9Y9/DTy8rAXSQGr0Hja6Nqx/Z2OEM6yCcaIY/9cxyLuiPBDoX60nEG92mpSYr9zJ27DcPUf2TtjKhlX8So58NrQuYKSL9hIyd00JVk3q+DFHOWcqZR22VVe4mmtqY+PKOhqXjV5PgPk/DYGbUpfROiJ4b064xBbs60v/9iPW3SPis9yXIZQOyrybQC3bQ98BXCMEg7KyVcXC60AHSYx4/6eKj5ZhJUmZEZT6weu/YDxbVojuYckcL4x5YyuKyvxdesS/8fR4BJXWi8+iiUYe6AT077sej0y/J6W+wa5LXpwba6Orp4/5BRmGc+im4ugqYHdVpeX57S+MzrFv7ErShMyqVdNpmt2NkbUuKFdcPLIAptFDCd8W+XPrn0wDyeuetk3FFWjAIN7Ci8T82tvEDmIO1VjEvi3O+HzZgKr7xJgd4H6evON+acFKpfHVesUEEmBhSJZoBQ/jZH6xoAUUDjC6rWeKfI27TvWFDiKkvnHqBVavyKN/A5X2HvfNYuXCXaJARwi+XRZ3vpqw+BNH0BguNkuk4yhg8PFdWC3JQs4gcK6+hqBTmuLCf02eEGBTJQW0UkKI6mxwxMgqnXUxGhLGuUx8TxPFJvTP+tva+isTKjLBEGVWJGfRjteZhKenTmHrYyLWCZ6culaBjMpgbLG3bHVMuds/fgyTM67McDaVWHWsMCTGHasLWbKR4J3N92PIFaEEB7evReN7VXJPICy/S9DSJRKSr7t/lMwZHsvIe54qR4UBYWQTk1tEh8zasPeP28pO2soxYhygU8UgN1FNYH7MBJSwc8IV2Rbk20Jjp5Uhcdh9CN8hsLrOLFi0rbn9SYgpRZETATlwJRkhwRJx PmLjN2O7 iSszCbPKLoxUt0+T0Hw8IFTYMyNgoYn5DiQbMzm/ukgLTnmgam9Y6qTItxUOgvS4KEdWejD1DLEGRsjpZZWyUlHqJPSnPR7ed6cI0EWVhnl83RrRgCtfU8DC0lpqs5eu07XqIjjtdAth8sg0AjeACLKodeHnwS3blJMqJbdzpOLw2sPPV7ragK6GW4sZxAhE+biS0Q+VV1+RwfVdv0k+hq/upQoErwML5c4DH8NqJkPKV+LIyde9zaweaG39X45N4ClshUHTG+UMSyOHplh2r14yUgNd76F1F6SM/uOspaFx0TVTVRL1RKgTNieGD771nbS2O2Yq5X5KMxSSoEQtO1Ua45zy4OIzZsG7guqsIcYvNFuNSFCOltH7hiEmQsDUiLll7ACZmX+wgWnY= 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 Wed, Jul 31, 2024 at 5:50=E2=80=AFAM Yunsheng Lin wrote: > > Basing on the lib/objpool.c, change it to something like a > ptrpool, so that we can utilize that to test the correctness > and performance of the page_frag. > > The testing is done by ensuring that the fragment allocated > from a frag_frag_cache instance is pushed into a ptrpool > instance in a kthread binded to a specified cpu, and a kthread > binded to a specified cpu will pop the fragment from the > ptrpool and free the fragment. > > We may refactor out the common part between objpool and ptrpool > if this ptrpool thing turns out to be helpful for other place. This isn't a patch where you should be introducing stuff you hope to refactor out and reuse later. Your objpoo/ptrpool stuff is just going to add bloat and overhead as you are going to have to do pointer changes to get them in and out of memory and you are having to scan per-cpu lists. You would be better served using a simple array as your threads should be stick to a consistent CPU anyway in terms of testing. I would suggest keeping this much more simple. Trying to pattern this after something like the dmapool_test code would be a better way to go for this. We don't need all this extra objpool overhead getting in the way of testing the code you should be focused on. Just allocate your array on one specific CPU and start placing and removing your pages from there instead of messing with the push/pop semantics. Lastly something that is a module only tester that always fails to probe doesn't sound like it really makes sense as a standard kernel module. I still think it would make more sense to move it to the selftests tree and just have it build there as a module instead of trying to force it into the mm tree. The example of dmapool_test makes sense as it could be run at early boot to run the test and then it just goes quiet. This module won't load and will always just return -EAGAIN which doesn't sound like a valid kernel module to me.