linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: "Huang\, Ying" <ying.huang@intel.com>
To: Hillf Danton <hillf.zj@alibaba-inc.com>
Cc: "'Huang, Ying'" <ying.huang@intel.com>,
	'Andrew Morton' <akpm@linux-foundation.org>,
	tim.c.chen@intel.com, dave.hansen@intel.com,
	andi.kleen@intel.com, aaron.lu@intel.com, linux-mm@kvack.org,
	linux-kernel@vger.kernel.org, 'Hugh Dickins' <hughd@google.com>,
	'Shaohua Li' <shli@kernel.org>,
	'Minchan Kim' <minchan@kernel.org>,
	'Rik van Riel' <riel@redhat.com>,
	'Andrea Arcangeli' <aarcange@redhat.com>,
	"'Kirill A . Shutemov'" <kirill.shutemov@linux.intel.com>
Subject: Re: [PATCH -v4 RESEND 6/9] mm, THP, swap: Support to add/delete THP to/from swap cache
Date: Fri, 28 Oct 2016 16:30:43 +0800	[thread overview]
Message-ID: <87lgx87u4s.fsf@yhuang-dev.intel.com> (raw)
In-Reply-To: <050a01d230f2$826f0b20$874d2160$@alibaba-inc.com> (Hillf Danton's message of "Fri, 28 Oct 2016 16:08:46 +0800")

Hi, Hillf,

Hillf Danton <hillf.zj@alibaba-inc.com> writes:

> On Friday, October 28, 2016 1:56 PM Huang, Ying wrote:
>> 
>> @@ -109,9 +118,16 @@ int __add_to_swap_cache(struct page *page, swp_entry_t entry)
>>  		 * So add_to_swap_cache() doesn't returns -EEXIST.
>>  		 */
>>  		VM_BUG_ON(error == -EEXIST);
>> -		set_page_private(page, 0UL);
>>  		ClearPageSwapCache(page);
>> -		put_page(page);
>> +		set_page_private(cur_page, 0UL);
>> +		while (i--) {
>> +			cur_page--;
>> +			cur_entry.val--;
>> +			set_page_private(cur_page, 0UL);
>> +			radix_tree_delete(&address_space->page_tree,
>> +					  swp_offset(cur_entry));
>> +		}
>
> Pull pages out of radix tree with tree lock held?

OOPS, I should hold the tree lock for the error path too.  Will update
it in the next version.  Thanks for pointing out this!

Best Regards,
Huang, Ying


>> +		page_ref_sub(page, nr);
>>  	}
>> 
>>  	return error;
>> 

--
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:[~2016-10-28  8:30 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-28  5:55 [PATCH -v4 RESEND 0/9] THP swap: Delay splitting THP during swapping out Huang, Ying
2016-10-28  5:56 ` [PATCH -v4 RESEND 1/9] mm, swap: Make swap cluster size same of THP size on x86_64 Huang, Ying
2016-10-28  5:56 ` [PATCH -v4 RESEND 2/9] mm, memcg: Support to charge/uncharge multiple swap entries Huang, Ying
2016-10-28  5:56 ` [PATCH -v4 RESEND 3/9] mm, THP, swap: Add swap cluster allocate/free functions Huang, Ying
2016-10-28  5:56 ` [PATCH -v4 RESEND 4/9] mm, THP, swap: Add get_huge_swap_page() Huang, Ying
2016-10-28  5:56 ` [PATCH -v4 RESEND 5/9] mm, THP, swap: Support to clear SWAP_HAS_CACHE for huge page Huang, Ying
2016-10-28  5:56 ` [PATCH -v4 RESEND 6/9] mm, THP, swap: Support to add/delete THP to/from swap cache Huang, Ying
2016-10-28  8:08   ` Hillf Danton
2016-10-28  8:30     ` Huang, Ying [this message]
2016-10-28  5:56 ` [PATCH -v4 RESEND 7/9] mm, THP: Add can_split_huge_page() Huang, Ying
2016-10-28  5:56 ` [PATCH -v4 RESEND 8/9] mm, THP, swap: Support to split THP in swap cache Huang, Ying
2016-10-28 10:18   ` Hillf Danton
2016-10-31  1:26     ` Huang, Ying
2016-10-28  5:56 ` [PATCH -v4 RESEND 9/9] mm, THP, swap: Delay splitting THP during swap out Huang, Ying

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=87lgx87u4s.fsf@yhuang-dev.intel.com \
    --to=ying.huang@intel.com \
    --cc=aarcange@redhat.com \
    --cc=aaron.lu@intel.com \
    --cc=akpm@linux-foundation.org \
    --cc=andi.kleen@intel.com \
    --cc=dave.hansen@intel.com \
    --cc=hillf.zj@alibaba-inc.com \
    --cc=hughd@google.com \
    --cc=kirill.shutemov@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=minchan@kernel.org \
    --cc=riel@redhat.com \
    --cc=shli@kernel.org \
    --cc=tim.c.chen@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