All of lore.kernel.org
 help / color / mirror / Atom feed
From: Nicholas Piggin <npiggin@gmail.com>
To: Christoph Hellwig <hch@lst.de>,
	Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org,
	linux-mm@kvack.org, Robin Murphy <robin.murphy@arm.com>
Subject: Re: [PATCH 2/5] kernel/dma: remove unnecessary unmap_kernel_range
Date: Thu, 28 Jan 2021 09:44:15 +1000	[thread overview]
Message-ID: <1611790740.civn6atbwp.astroid@bobo.none> (raw)
In-Reply-To: <20210127071059.GA21133@lst.de>

Excerpts from Christoph Hellwig's message of January 27, 2021 5:10 pm:
> On Tue, Jan 26, 2021 at 05:08:46PM -0500, Konrad Rzeszutek Wilk wrote:
>> On Tue, Jan 26, 2021 at 02:54:01PM +1000, Nicholas Piggin wrote:
>> > vunmap will remove ptes.
>> 
>> Should there be some ASSERT after the vunmap to make sure that is the
>> case? 
> 
> Not really.  removing the PTEs is the whole point of vunmap.  Everything
> else is just house keeping.

Agree. I did double check this and wrote a quick test to check ptes were 
there before the vunmap and cleared after, just to make sure I didn't 
make a silly mistake with the patch. But in general drivers should be 
able to trust code behind the API call will do the right thing. Such 
assertions should go in the vunmap() implementation as appropriate.

Thanks,
Nick

WARNING: multiple messages have this Message-ID (diff)
From: Nicholas Piggin <npiggin@gmail.com>
To: Christoph Hellwig <hch@lst.de>,
	Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Cc: linux-mm@kvack.org, Andrew Morton <akpm@linux-foundation.org>,
	Robin Murphy <robin.murphy@arm.com>,
	iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/5] kernel/dma: remove unnecessary unmap_kernel_range
Date: Thu, 28 Jan 2021 09:44:15 +1000	[thread overview]
Message-ID: <1611790740.civn6atbwp.astroid@bobo.none> (raw)
In-Reply-To: <20210127071059.GA21133@lst.de>

Excerpts from Christoph Hellwig's message of January 27, 2021 5:10 pm:
> On Tue, Jan 26, 2021 at 05:08:46PM -0500, Konrad Rzeszutek Wilk wrote:
>> On Tue, Jan 26, 2021 at 02:54:01PM +1000, Nicholas Piggin wrote:
>> > vunmap will remove ptes.
>> 
>> Should there be some ASSERT after the vunmap to make sure that is the
>> case? 
> 
> Not really.  removing the PTEs is the whole point of vunmap.  Everything
> else is just house keeping.

Agree. I did double check this and wrote a quick test to check ptes were 
there before the vunmap and cleared after, just to make sure I didn't 
make a silly mistake with the patch. But in general drivers should be 
able to trust code behind the API call will do the right thing. Such 
assertions should go in the vunmap() implementation as appropriate.

Thanks,
Nick
_______________________________________________
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu

  reply	other threads:[~2021-01-27 23:47 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-26  4:53 [PATCH 0/5] mm/vmalloc: cleanup after hugepage series Nicholas Piggin
2021-01-26  4:54 ` [PATCH 1/5] mm/vmalloc: remove map_kernel_range Nicholas Piggin
2021-01-26  6:37   ` Christoph Hellwig
2021-01-26  4:54 ` [PATCH 2/5] kernel/dma: remove unnecessary unmap_kernel_range Nicholas Piggin
2021-01-26  4:54   ` Nicholas Piggin
2021-01-26  6:38   ` Christoph Hellwig
2021-01-26  6:38     ` Christoph Hellwig
2021-01-26 22:08   ` Konrad Rzeszutek Wilk
2021-01-26 22:08     ` Konrad Rzeszutek Wilk
2021-01-27  7:10     ` Christoph Hellwig
2021-01-27  7:10       ` Christoph Hellwig
2021-01-27 23:44       ` Nicholas Piggin [this message]
2021-01-27 23:44         ` Nicholas Piggin
2021-01-26  4:54 ` [PATCH 3/5] powerpc/xive: " Nicholas Piggin
2021-01-26  4:54   ` Nicholas Piggin
2021-01-26  6:38   ` Christoph Hellwig
2021-01-26  6:38     ` Christoph Hellwig
2021-01-26  7:25   ` Cédric Le Goater
2021-01-26  7:25     ` Cédric Le Goater
2021-01-26  4:54 ` [PATCH 4/5] mm/vmalloc: remove unmap_kernel_range Nicholas Piggin
2021-01-26  6:38   ` Christoph Hellwig
2021-01-26  4:54 ` [PATCH 5/5] mm/vmalloc: improve allocation failure error messages Nicholas Piggin
2021-01-26  6:39   ` Christoph Hellwig

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=1611790740.civn6atbwp.astroid@bobo.none \
    --to=npiggin@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=hch@lst.de \
    --cc=iommu@lists.linux-foundation.org \
    --cc=konrad.wilk@oracle.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=robin.murphy@arm.com \
    /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.