All of lore.kernel.org
 help / color / mirror / Atom feed
From: Baoquan He <bhe@redhat.com>
To: Lorenzo Stoakes <lstoakes@gmail.com>
Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org,
	akpm@linux-foundation.org, stephen.s.brennan@oracle.com,
	urezki@gmail.com, willy@infradead.org, hch@infradead.org,
	error27@gmail.com
Subject: Re: [PATCH v4 3/7] mm/vmalloc.c: allow vread() to read out vm_map_ram areas
Date: Thu, 2 Feb 2023 21:18:23 +0800	[thread overview]
Message-ID: <Y9u3+vQqE5e/EXeO@MiWiFi-R3L-srv> (raw)
In-Reply-To: <Y9tjnP2r7RqbFd7a@lucifer>

On 02/02/23 at 07:17am, Lorenzo Stoakes wrote:
> On Thu, Feb 02, 2023 at 11:20:07AM +0800, Baoquan He wrote:
> 
> [snip]
> 
> > > > +	for_each_set_bitrange(rs, re, vb->used_map, VMAP_BBMAP_BITS) {
> > > > +		if (!count)
> > > > +			break;
> > > > +		start = vmap_block_vaddr(vb->va->va_start, rs);
> > > > +		while (addr < start) {
> > > > +			if (count == 0)
> > > > +				break;
> > >
> > > Bit pedantic, but you're using the `if (!count)` form of checking whether it's
> > > zero above, but here you explicitly check it, would be good to keep both consistent.
> >
> > Yeah, sounds good. Will change.
> >
> > >
> > > Given you're checking here, perhaps you could simply drop the previous check?
> >
> > Well, maybe no. The previous "if (!count)" is checking if count is 0
> > after the 'count -=n;' line at the end of the for_each loop. While this
> > "if (count == 0)" is checking if count is 0 after 'count--;' at the end
> > of while loop. Not sure if I got your point.
> 
> You're right, sorry each break is for a different loop :) and I guess the inner
> check is feeding the outer one so we're all good.

Oh, the inner check and break only terminates the while loop, but it
should jump to the 'spin_unlock(&vb->lock);' line too as the outer
break does. I will fix this.



  reply	other threads:[~2023-02-02 13:18 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-01  9:13 [PATCH v4 0/7] mm/vmalloc.c: allow vread() to read out vm_map_ram areas Baoquan He
2023-02-01  9:13 ` [PATCH v4 1/7] mm/vmalloc.c: add used_map into vmap_block to track space of vmap_block Baoquan He
2023-02-01  9:13 ` [PATCH v4 2/7] mm/vmalloc.c: add flags to mark vm_map_ram area Baoquan He
2023-02-01  9:13 ` [PATCH v4 3/7] mm/vmalloc.c: allow vread() to read out vm_map_ram areas Baoquan He
2023-02-01 20:16   ` Lorenzo Stoakes
2023-02-02  3:20     ` Baoquan He
2023-02-02  7:17       ` Lorenzo Stoakes
2023-02-02 13:18         ` Baoquan He [this message]
2023-02-01  9:13 ` [PATCH v4 4/7] mm/vmalloc: explicitly identify vm_map_ram area when shown in /proc/vmcoreinfo Baoquan He
2023-02-01 20:17   ` Lorenzo Stoakes
2023-02-01  9:13 ` [PATCH v4 5/7] mm/vmalloc: skip the uninitilized vmalloc areas Baoquan He
2023-02-01  9:13 ` [PATCH v4 6/7] powerpc: mm: add VM_IOREMAP flag to the vmalloc area Baoquan He
2023-02-01  9:13 ` [PATCH v4 7/7] sh: mm: set " Baoquan He
2023-02-02 17:47 ` [PATCH v4 0/7] mm/vmalloc.c: allow vread() to read out vm_map_ram areas Stephen Brennan
2023-02-04  4:12   ` Baoquan He
2023-02-04 23:13     ` Andrew Morton
2023-02-06  8:43       ` Baoquan He

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=Y9u3+vQqE5e/EXeO@MiWiFi-R3L-srv \
    --to=bhe@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=error27@gmail.com \
    --cc=hch@infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=lstoakes@gmail.com \
    --cc=stephen.s.brennan@oracle.com \
    --cc=urezki@gmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.