linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Qing Huang <qing.huang@oracle.com>
To: Christoph Hellwig <hch@infradead.org>
Cc: linux-rdma@vger.kernel.org, linux-kernel@vger.kernel.org,
	dledford@redhat.com, sean.hefty@intel.com, artemyko@mellanox.com,
	linux-mm@kvack.org
Subject: Re: [PATCH] ib/core: not to set page dirty bit if it's already set.
Date: Tue, 23 May 2017 14:39:38 -0700	[thread overview]
Message-ID: <045c8fb5-fa64-c0e0-c5e4-2734f849a66a@oracle.com> (raw)
In-Reply-To: <20170523074234.GE29525@infradead.org>



On 5/23/2017 12:42 AM, Christoph Hellwig wrote:
> On Mon, May 22, 2017 at 04:43:57PM -0700, Qing Huang wrote:
>> On 5/19/2017 6:05 AM, Christoph Hellwig wrote:
>>> On Thu, May 18, 2017 at 04:33:53PM -0700, Qing Huang wrote:
>>>> This change will optimize kernel memory deregistration operations.
>>>> __ib_umem_release() used to call set_page_dirty_lock() against every
>>>> writable page in its memory region. Its purpose is to keep data
>>>> synced between CPU and DMA device when swapping happens after mem
>>>> deregistration ops. Now we choose not to set page dirty bit if it's
>>>> already set by kernel prior to calling __ib_umem_release(). This
>>>> reduces memory deregistration time by half or even more when we ran
>>>> application simulation test program.
>>> As far as I can tell this code doesn't even need set_page_dirty_lock
>>> and could just use set_page_dirty
>> It seems that set_page_dirty_lock has been used here for more than 10 years.
>> Don't know the original purpose. Maybe it was used to prevent races between
>> setting dirty bits and swapping out pages?
> I suspect copy & paste.  Or maybe I don't actually understand the
> explanation of set_page_dirty vs set_page_dirty_lock enough.  But
> I'd rather not hack around the problem.
> --
I think there are two parts here. First part is that we don't need to 
set the dirty bit if it's already set. Second part is whether we use 
set_page_dirty or set_page_dirty_lock to set dirty bits.


--
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>

      reply	other threads:[~2017-05-23 21:40 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20170518233353.14370-1-qing.huang@oracle.com>
2017-05-19 13:05 ` [PATCH] ib/core: not to set page dirty bit if it's already set Christoph Hellwig
2017-05-22 23:32   ` Qing Huang
2017-05-22 23:43   ` Qing Huang
2017-05-23  7:42     ` Christoph Hellwig
2017-05-23 21:39       ` Qing Huang [this message]

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=045c8fb5-fa64-c0e0-c5e4-2734f849a66a@oracle.com \
    --to=qing.huang@oracle.com \
    --cc=artemyko@mellanox.com \
    --cc=dledford@redhat.com \
    --cc=hch@infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=linux-rdma@vger.kernel.org \
    --cc=sean.hefty@intel.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;
as well as URLs for NNTP newsgroup(s).