lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <550BD183.5020005@suse.cz>
Date:	Fri, 20 Mar 2015 08:51:31 +0100
From:	Vlastimil Babka <vbabka@...e.cz>
To:	Gioh Kim <gioh.kim@....com>, akpm@...ux-foundation.org,
	rientjes@...gle.com, iamjoonsoo.kim@....com, mgorman@...e.de
CC:	linux-mm@...ck.org, linux-kernel@...r.kernel.org, gunho.lee@....com
Subject: Re: [PATCH] [RFC] mm/compaction: initialize compaction information

On 03/20/2015 12:33 AM, Gioh Kim wrote:
>>> diff --git a/mm/compaction.c b/mm/compaction.c
>>> index 8c0d945..827ec06 100644
>>> --- a/mm/compaction.c
>>> +++ b/mm/compaction.c
>>> @@ -1587,8 +1587,10 @@ static void __compact_pgdat(pg_data_t *pgdat, struct compact_control *cc)
>>>                    INIT_LIST_HEAD(&cc->freepages);
>>>                    INIT_LIST_HEAD(&cc->migratepages);
>>>
>>> -               if (cc->order == -1 || !compaction_deferred(zone, cc->order))
>>> +               if (cc->order == -1 || !compaction_deferred(zone, cc->order)) {
>>> +                       __reset_isolation_suitable(zone);
>>
>> This will also trigger reset when called from kswapd through compact_pgdat() and
>> !compaction_deferred() is true.
>> The reset should be restricted to cc->order == -1 which only happens from /proc
>> trigger.
>>
>>>                            compact_zone(zone, cc);
>>> +               }
>>>
>>>                    if (cc->order > 0) {
>>>                            if (zone_watermark_ok(zone, cc->order,
>>>
>>
>>
>
> I've not been familiar with compaction code.
> I think cc->order is -1 only if __compact_pgdat is called via /proc.

Yes that's what I meant.

> This is ugly but I don't have better solution.
> Do you have better idea?

It's not ugly IMHO. There are more tests for -1 like this, e.g. in
compaction_suitable(). Maybe just add some comment such as:

/*
  * When called via /proc/sys/vm/compact_memory make sure we compact
  * the whole zone regardless of cached scanner positions.
  */

> diff --git a/mm/compaction.c b/mm/compaction.c
> index 8c0d945..5b4e255 100644
> --- a/mm/compaction.c
> +++ b/mm/compaction.c
> @@ -1587,6 +1587,9 @@ static void __compact_pgdat(pg_data_t *pgdat, struct compact_control *cc)
>                   INIT_LIST_HEAD(&cc->freepages);
>                   INIT_LIST_HEAD(&cc->migratepages);
>
> +               if (cc->order == -1)
> +                       __reset_isolation_suitable(zone);
> +
>                   if (cc->order == -1 || !compaction_deferred(zone, cc->order))
>                           compact_zone(zone, cc);
>
>
>

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ