Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1632099

Re: [PATCH -mm -v10 1/3] mm, THP, swap: Delay splitting THP during swap out

From Johannes Weiner <hannes@cmpxchg.org>
Newsgroups linux.kernel
Subject Re: [PATCH -mm -v10 1/3] mm, THP, swap: Delay splitting THP during swap out
Date 2017-04-27 15:40 +0200
Message-ID <tAROh-1eg-1@gated-at.bofh.it> (permalink)
References <tA8et-4Pu-17@gated-at.bofh.it> <tA8et-4Pu-15@gated-at.bofh.it> <tAKjL-4vc-9@gated-at.bofh.it> <tALSx-5DA-1@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Thu, Apr 27, 2017 at 03:12:34PM +0800, Huang, Ying wrote:
> Minchan Kim <minchan@kernel.org> writes:
> > On Tue, Apr 25, 2017 at 08:56:56PM +0800, Huang, Ying wrote:
> >> @@ -178,20 +192,12 @@ int add_to_swap(struct page *page, struct list_head *list)
> >>  	VM_BUG_ON_PAGE(!PageLocked(page), page);
> >>  	VM_BUG_ON_PAGE(!PageUptodate(page), page);
> >>  
> >> -	entry = get_swap_page();
> >> +retry:
> >> +	entry = get_swap_page(page);
> >>  	if (!entry.val)
> >> -		return 0;
> >> -
> >> -	if (mem_cgroup_try_charge_swap(page, entry)) {
> >> -		swapcache_free(entry);
> >> -		return 0;
> >> -	}
> >> -
> >> -	if (unlikely(PageTransHuge(page)))
> >> -		if (unlikely(split_huge_page_to_list(page, list))) {
> >> -			swapcache_free(entry);
> >> -			return 0;
> >> -		}
> >> +		goto fail;
> >
> > So, with non-SSD swap, THP page *always* get the fail to get swp_entry_t
> > and retry after split the page. However, it makes unncessary get_swap_pages
> > call which is not trivial. If there is no SSD swap, thp-swap out should
> > be void without adding any performance overhead.
> > Hmm, but I have no good idea to do it simple. :(
> 
> For HDD swap, the device raw throughput is so low (< 100M Bps
> typically), that the added overhead here will not be a big issue.  Do
> you agree?

I fully agree. If you swap to spinning rust, an extra function call
here is the least of your concern.

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH -mm -v10 1/3] mm, THP, swap: Delay splitting THP during swap out "Huang, Ying" <ying.huang@intel.com> - 2017-04-25 15:00 +0200
  Re: [PATCH -mm -v10 1/3] mm, THP, swap: Delay splitting THP during  swap out Minchan Kim <minchan@kernel.org> - 2017-04-27 07:40 +0200
    Re: [PATCH -mm -v10 1/3] mm, THP, swap: Delay splitting THP during swap out "Huang\, Ying" <ying.huang@intel.com> - 2017-04-27 09:20 +0200
      Re: [PATCH -mm -v10 1/3] mm, THP, swap: Delay splitting THP during  swap out Johannes Weiner <hannes@cmpxchg.org> - 2017-04-27 15:40 +0200
      Re: [PATCH -mm -v10 1/3] mm, THP, swap: Delay splitting THP during  swap out Minchan Kim <minchan@kernel.org> - 2017-04-28 10:50 +0200
        Re: [PATCH -mm -v10 1/3] mm, THP, swap: Delay splitting THP during swap out "Huang\, Ying" <ying.huang@intel.com> - 2017-04-28 14:30 +0200
          Re: [PATCH -mm -v10 1/3] mm, THP, swap: Delay splitting THP during  swap out Minchan Kim <minchan@kernel.org> - 2017-05-10 03:10 +0200
        Re: [PATCH -mm -v10 1/3] mm, THP, swap: Delay splitting THP during  swap out Johannes Weiner <hannes@cmpxchg.org> - 2017-05-01 12:50 +0200
          Re: [PATCH -mm -v10 1/3] mm, THP, swap: Delay splitting THP during  swap out Minchan Kim <minchan@kernel.org> - 2017-05-02 02:00 +0200
            Re: [PATCH -mm -v10 1/3] mm, THP, swap: Delay splitting THP during  swap out Johannes Weiner <hannes@cmpxchg.org> - 2017-05-10 16:00 +0200
              Re: [PATCH -mm -v10 1/3] mm, THP, swap: Delay splitting THP during  swap out Minchan Kim <minchan@kernel.org> - 2017-05-11 01:30 +0200
                Re: [PATCH -mm -v10 1/3] mm, THP, swap: Delay splitting THP during swap out "Huang\, Ying" <ying.huang@intel.com> - 2017-05-11 03:00 +0200
                Re: [PATCH -mm -v10 1/3] mm, THP, swap: Delay splitting THP during  swap out Minchan Kim <minchan@kernel.org> - 2017-05-11 06:40 +0200
                Re: [PATCH -mm -v10 1/3] mm, THP, swap: Delay splitting THP during  swap out Minchan Kim <minchan@kernel.org> - 2017-05-11 03:30 +0200
                Re: [PATCH -mm -v10 1/3] mm, THP, swap: Delay splitting THP during  swap out Johannes Weiner <hannes@cmpxchg.org> - 2017-05-11 12:50 +0200

csiph-web