linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Tony Battersby <tonyb@cybernetics.com>
To: linux-mm@kvack.org, linux-kernel@vger.kernel.org
Cc: iommu@lists.linux-foundation.org, kernel-team@fb.com,
	Matthew Wilcox <willy@infradead.org>,
	Keith Busch <kbusch@kernel.org>,
	Andy Shevchenko <andy.shevchenko@gmail.com>,
	Robin Murphy <robin.murphy@arm.com>,
	Tony Lindgren <tony@atomide.com>
Subject: [PATCH v6 08/11] dmapool: speedup DMAPOOL_DEBUG with init_on_alloc
Date: Tue, 7 Jun 2022 14:44:58 -0400	[thread overview]
Message-ID: <b1100f23-7a75-c5a0-851c-42d62554efa2@cybernetics.com> (raw)
In-Reply-To: <340ff8ef-9ff5-7175-c234-4132bbdfc5f7@cybernetics.com>

Avoid double-memset of the same allocated memory in dma_pool_alloc()
when both DMAPOOL_DEBUG is enabled and init_on_alloc=1.

Signed-off-by: Tony Battersby <tonyb@cybernetics.com>
---
 mm/dmapool.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mm/dmapool.c b/mm/dmapool.c
index 44038089a41a..c7ec38cb4631 100644
--- a/mm/dmapool.c
+++ b/mm/dmapool.c
@@ -356,7 +356,7 @@ void *dma_pool_alloc(struct dma_pool *pool, gfp_t mem_flags,
 			break;
 		}
 	}
-	if (!(mem_flags & __GFP_ZERO))
+	if (!want_init_on_alloc(mem_flags))
 		memset(retval, POOL_POISON_ALLOCATED, pool->size);
 #endif
 	spin_unlock_irqrestore(&pool->lock, flags);
-- 
2.25.1



  parent reply	other threads:[~2022-06-07 18:45 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-07 18:38 [PATCH v6 00/11] mpt3sas and dmapool scalability Tony Battersby
2022-06-07 18:39 ` [PATCH v6 01/11] dmapool: remove checks for dev == NULL Tony Battersby
2022-06-07 18:40 ` [PATCH v6 02/11] dmapool: use sysfs_emit() instead of scnprintf() Tony Battersby
2022-06-07 18:41 ` [PATCH v6 03/11] dmapool: cleanup integer types Tony Battersby
2022-06-07 18:42 ` [PATCH v6 04/11] dmapool: fix boundary comparison Tony Battersby
2022-06-07 18:42 ` [PATCH v6 05/11] dmapool: improve accuracy of debug statistics Tony Battersby
2022-06-07 18:43 ` [PATCH v6 06/11] dmapool: debug: prevent endless loop in case of corruption Tony Battersby
2022-06-07 18:44 ` [PATCH v6 07/11] dmapool: ignore init_on_free when DMAPOOL_DEBUG enabled Tony Battersby
2022-06-07 18:44 ` Tony Battersby [this message]
2022-06-07 18:45 ` [PATCH v6 09/11] dmapool: cleanup dma_pool_destroy Tony Battersby
2022-06-07 18:46 ` [PATCH v6 10/11] dmapool: improve scalability of dma_pool_alloc Tony Battersby
2022-06-07 18:46 ` [PATCH v6 11/11] dmapool: improve scalability of dma_pool_free Tony Battersby

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=b1100f23-7a75-c5a0-851c-42d62554efa2@cybernetics.com \
    --to=tonyb@cybernetics.com \
    --cc=andy.shevchenko@gmail.com \
    --cc=iommu@lists.linux-foundation.org \
    --cc=kbusch@kernel.org \
    --cc=kernel-team@fb.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=robin.murphy@arm.com \
    --cc=tony@atomide.com \
    --cc=willy@infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox