From: Vineeth Remanan Pillai <vpillai@digitalocean.com>
To: Matthew Wilcox <willy@infradead.org>
Cc: Hugh Dickins <hughd@google.com>,
Andrew Morton <akpm@linux-foundation.org>,
linux-mm@kvack.org, linux-kernel@vger.kernel.org,
Kelley Nielsen <kelleynnn@gmail.com>,
Rik van Riel <riel@surriel.com>
Subject: Re: [PATCH v2] mm: prototype: rid swapoff of quadratic complexity
Date: Mon, 3 Dec 2018 09:35:24 -0500 [thread overview]
Message-ID: <8ec7fc5f-3c14-5faa-541e-45f5b980a98d@digitalocean.com> (raw)
In-Reply-To: <21acdf55-dbcb-1c8f-4783-9bb496dcbca3@digitalocean.com>
Hi Matthew,
>> This seems terribly complicated. You run through i_pages, record the
>> indices of the swap entries, then go back and look them up again by
>> calling shmem_getpage() which calls the incredibly complex 300 line
>> shmem_getpage_gfp().
>>
>> Can we refactor shmem_getpage_gfp() to skip some of the checks which
>> aren't necessary when called from this path, and turn this into a nice
>> simple xas_for_each() loop which works one entry at a time?
>
> I shall investigate this and make this simpler as you suggested.
I have looked into this deeper. I think it would be very difficult to
consolidate the whole logic into a single xas_for_each() loop because,
we do disk io and might sleep. I have refactored the code such that it
much more readable now and I am using the same format used by
find_get_entries.
Will send out the next revision later today.
Thanks,
Vineeth
prev parent reply other threads:[~2018-12-03 14:35 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-11-26 16:55 Vineeth Remanan Pillai
2018-11-26 17:22 ` Matthew Wilcox
2018-11-26 18:35 ` Vineeth Remanan Pillai
2018-12-03 14:35 ` Vineeth Remanan Pillai [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=8ec7fc5f-3c14-5faa-541e-45f5b980a98d@digitalocean.com \
--to=vpillai@digitalocean.com \
--cc=akpm@linux-foundation.org \
--cc=hughd@google.com \
--cc=kelleynnn@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=riel@surriel.com \
--cc=willy@infradead.org \
/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