Linux-mm Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Vlastimil Babka (SUSE)" <vbabka@kernel.org>
To: rob.clark@oss.qualcomm.com
Cc: Christoph Hellwig <hch@lst.de>, Harry Yoo <harry@kernel.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	Mark Brown <broonie@kernel.org>, Hao Li <hao.li@linux.dev>,
	Christoph Lameter <cl@gentwo.org>,
	David Rientjes <rientjes@google.com>,
	Roman Gushchin <roman.gushchin@linux.dev>,
	Jesper Dangaard Brouer <hawk@kernel.org>,
	linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org,
	freedreno@lists.freedesktop.org, linux-kernel@vger.kernel.org,
	linux-mm@kvack.org, io-uring@vger.kernel.org,
	kasan-dev@googlegroups.com, bpf@vger.kernel.org,
	netdev@vger.kernel.org,
	Alexander Lobakin <aleksander.lobakin@intel.com>,
	Boris Brezillon <boris.brezillon@collabora.com>
Subject: Re: [PATCH] mm/slab: improve kmem_cache_alloc_bulk
Date: Wed, 3 Jun 2026 18:22:38 +0200	[thread overview]
Message-ID: <b6f6323e-6f5b-4928-b474-bd2743eac3f2@kernel.org> (raw)
In-Reply-To: <CACSVV02v0Fuc6=Rqyd89D-_tcSjEXuQmxz0+2-4aoRAEwJE4zg@mail.gmail.com>

On 6/3/26 13:13, Rob Clark wrote:
> On Wed, Jun 3, 2026 at 2:17 AM Vlastimil Babka (SUSE) <vbabka@kernel.org> wrote:
>>
>> We know p->pages is NULL in this case, right? Because it was allocated by
>> vm_bind_job_create() using kzalloc().
>> And the job can't be reused with a leftover value?
>> (msm_iommu_pagetable_prealloc_cleanup doesn't set p->pages to zero).
>> Or should we set p->pages to NULL here.
> 
> Correct, the job is not reused.  But I suppose setting p->pages to
> NULL would make things more obvious, so no objection to that.

OK, did that, just in case. Thanks.

> BR,
> -R
> 
>> > +
>> >         p->pages = kvmalloc_objs(*p->pages, p->count);
>> >         if (!p->pages)
>> >                 return -ENOMEM;
>> >
>> >         ret = kmem_cache_alloc_bulk(pt_cache, GFP_KERNEL, p->count, p->pages);
>> >         if (ret != p->count) {
>> > -               kfree(p->pages);
>> > +               kvfree(p->pages);
>> >                 p->pages = NULL;
>> >                 p->count = ret;
>> >                 return -ENOMEM;
>>



  reply	other threads:[~2026-06-03 16:22 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-28  9:34 improve the kmem_cache_alloc_bulk API v2 Christoph Hellwig
2026-05-28  9:34 ` [PATCH] mm/slab: improve kmem_cache_alloc_bulk Christoph Hellwig
2026-05-29 11:54   ` Vlastimil Babka (SUSE)
2026-05-29 13:50     ` Christoph Hellwig
2026-06-01  6:39       ` Harry Yoo
2026-06-01  7:56         ` msm_iommu_pagetable_prealloc_allocate, was: " Christoph Hellwig
2026-06-01  8:16         ` Vlastimil Babka (SUSE)
2026-06-01 11:38           ` Christoph Hellwig
2026-06-01 12:50             ` Vlastimil Babka (SUSE)
2026-06-01 13:32               ` Rob Clark
2026-06-01 14:39                 ` Rob Clark
2026-06-03  9:17                   ` Vlastimil Babka (SUSE)
2026-06-03 11:13                     ` Rob Clark
2026-06-03 16:22                       ` Vlastimil Babka (SUSE) [this message]
2026-06-04  7:10                         ` Harry Yoo
2026-06-04  7:35                           ` Vlastimil Babka (SUSE)
2026-06-04  9:36                             ` Rob Clark
2026-06-01 11:39           ` Harry Yoo
  -- strict thread matches above, loose matches on Subject: below --
2026-05-27  7:02 improve the kmem_cache_alloc_bulk API Christoph Hellwig
2026-05-27  7:02 ` [PATCH] mm/slab: improve kmem_cache_alloc_bulk Christoph Hellwig
2026-05-27  7:53   ` bot+bpf-ci
2026-05-27  8:51   ` Jesper Dangaard Brouer
2026-05-27 13:56     ` Alexander Lobakin
2026-05-27 14:07       ` Christoph Hellwig
2026-05-27  9:38   ` Vlastimil Babka (SUSE)
2026-05-27 12:20     ` Christoph Hellwig
2026-05-28  8:58   ` kernel test robot

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=b6f6323e-6f5b-4928-b474-bd2743eac3f2@kernel.org \
    --to=vbabka@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=aleksander.lobakin@intel.com \
    --cc=boris.brezillon@collabora.com \
    --cc=bpf@vger.kernel.org \
    --cc=broonie@kernel.org \
    --cc=cl@gentwo.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=freedreno@lists.freedesktop.org \
    --cc=hao.li@linux.dev \
    --cc=harry@kernel.org \
    --cc=hawk@kernel.org \
    --cc=hch@lst.de \
    --cc=io-uring@vger.kernel.org \
    --cc=kasan-dev@googlegroups.com \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=netdev@vger.kernel.org \
    --cc=rientjes@google.com \
    --cc=rob.clark@oss.qualcomm.com \
    --cc=roman.gushchin@linux.dev \
    /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