On Mon 11-04-16 16:39:21, Vlastimil Babka wrote:
On 04/05/2016 01:25 PM, Michal Hocko wrote:[...]
+/* Compaction has failed and it doesn't make much sense to keep retrying. */
+static inline bool compaction_failed(enum compact_result result)
+{
+ /* All zones where scanned completely and still not result. */
Hmm given that try_to_compact_pages() uses a max() on results, then in fact
it takes only one zone to get this. Others could have been also SKIPPED or
DEFERRED. Is that what you want?
In short I didn't find any better way and still guarantee a some
guarantee of convergence. COMPACT_COMPLETE means that at least one zone
was completely scanned and led to no result. That zone would be
compact_suitable by definition. If I made DEFERRED or SKIPPED more
priorite (aka higher in the enum) then I could easily end up in a state
where all zones would return COMPACT_COMPLETE and few remaining would
just alternate returning their DEFFERED resp. SKIPPED. So while this
might sound like giving up too early I couldn't come up with anything
more specific that would lead to reliable results.
I am open to any suggestions of course.