linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Joerg Roedel <joro@8bytes.org>
To: Oded Gabbay <oded.gabbay@gmail.com>
Cc: "Andrew Morton" <akpm@linux-foundation.org>,
	"David Airlie" <airlied@linux.ie>,
	"Alex Deucher" <alexander.deucher@amd.com>,
	"Jerome Glisse" <j.glisse@gmail.com>,
	linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org,
	"John Bridgman" <John.Bridgman@amd.com>,
	"Andrew Lewycky" <Andrew.Lewycky@amd.com>,
	linux-mm <linux-mm@kvack.org>,
	"Oded Gabbay" <oded.gabbay@amd.com>,
	"Naoya Horiguchi" <n-horiguchi@ah.jp.nec.com>,
	"Joonsoo Kim" <iamjoonsoo.kim@lge.com>,
	"Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>,
	"Hugh Dickins" <hughd@google.com>,
	"Cyrill Gorcunov" <gorcunov@openvz.org>,
	"Jérôme Glisse" <jglisse@redhat.com>,
	"Jianyu Zhan" <nasa4836@gmail.com>
Subject: Re: [PATCH 28/83] mm: Change timing of notification to IOMMUs about a page to be invalidated
Date: Fri, 11 Jul 2014 00:22:00 +0200	[thread overview]
Message-ID: <20140710222200.GZ1958@8bytes.org> (raw)
In-Reply-To: <1405029208-6703-1-git-send-email-oded.gabbay@amd.com>

On Fri, Jul 11, 2014 at 12:53:26AM +0300, Oded Gabbay wrote:
>  mm/rmap.c | 8 ++++++--
>  1 file changed, 6 insertions(+), 2 deletions(-)
> 
> diff --git a/mm/rmap.c b/mm/rmap.c
> index 196cd0c..73d4c3d 100644
> --- a/mm/rmap.c
> +++ b/mm/rmap.c
> @@ -1231,13 +1231,17 @@ static int try_to_unmap_one(struct page *page, struct vm_area_struct *vma,
>  	} else
>  		dec_mm_counter(mm, MM_FILEPAGES);
>  
> +	pte_unmap_unlock(pte, ptl);
> +
> +	mmu_notifier_invalidate_page(vma, address, event);
> +
>  	page_remove_rmap(page);
>  	page_cache_release(page);
>  
> +	return ret;
> +
>  out_unmap:
>  	pte_unmap_unlock(pte, ptl);
> -	if (ret != SWAP_FAIL && !(flags & TTU_MUNLOCK))
> -		mmu_notifier_invalidate_page(vma, address, event);
>  out:
>  	return ret;

I think there is no bug. In that function the page is just unmapped,
removed from the rmap (page_remove_rmap), and the LRU list
(page_cache_release). The page itself is not released in this function,
so the call mmu_notifier_invalidate_page() at the end is fine.


	Joerg


--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

  parent reply	other threads:[~2014-07-10 22:22 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-10 21:53 Oded Gabbay
2014-07-10 22:15 ` Andrew Morton
2014-07-10 22:22 ` Joerg Roedel [this message]
2014-07-10 22:34   ` Hugh Dickins

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=20140710222200.GZ1958@8bytes.org \
    --to=joro@8bytes.org \
    --cc=Andrew.Lewycky@amd.com \
    --cc=John.Bridgman@amd.com \
    --cc=airlied@linux.ie \
    --cc=akpm@linux-foundation.org \
    --cc=alexander.deucher@amd.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=gorcunov@openvz.org \
    --cc=hughd@google.com \
    --cc=iamjoonsoo.kim@lge.com \
    --cc=j.glisse@gmail.com \
    --cc=jglisse@redhat.com \
    --cc=kirill.shutemov@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=n-horiguchi@ah.jp.nec.com \
    --cc=nasa4836@gmail.com \
    --cc=oded.gabbay@amd.com \
    --cc=oded.gabbay@gmail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox