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: <c5ba7d24-1ad9-5f42-3c60-96aed4cc0a17@suse.cz>
Date:   Tue, 18 Apr 2017 10:23:12 +0200
From:   Vlastimil Babka <vbabka@...e.cz>
To:     Michal Hocko <mhocko@...nel.org>,
        Igor Mammedov <imammedo@...hat.com>
Cc:     linux-mm@...ck.org, Andrew Morton <akpm@...ux-foundation.org>,
        Mel Gorman <mgorman@...e.de>,
        Andrea Arcangeli <aarcange@...hat.com>,
        Jerome Glisse <jglisse@...hat.com>,
        Reza Arbab <arbab@...ux.vnet.ibm.com>,
        Yasuaki Ishimatsu <yasu.isimatu@...il.com>,
        qiuxishi@...wei.com, Kani Toshimitsu <toshi.kani@....com>,
        slaoub@...il.com, Joonsoo Kim <js1304@...il.com>,
        Andi Kleen <ak@...ux.intel.com>,
        David Rientjes <rientjes@...gle.com>,
        Daniel Kiper <daniel.kiper@...cle.com>,
        Vitaly Kuznetsov <vkuznets@...hat.com>,
        LKML <linux-kernel@...r.kernel.org>,
        Dan Williams <dan.j.williams@...il.com>,
        Heiko Carstens <heiko.carstens@...ibm.com>,
        Lai Jiangshan <laijs@...fujitsu.com>,
        Martin Schwidefsky <schwidefsky@...ibm.com>,
        Tobias Regnery <tobias.regnery@...il.com>
Subject: Re: [PATCH -v2 0/9] mm: make movable onlining suck less

On 04/10/2017 06:02 PM, Michal Hocko wrote:
> On Mon 10-04-17 16:27:49, Igor Mammedov wrote:
> [...]
>> #issue3:
>> removable flag flipped to non-removable state
>>
>> // before series at commit ef0b577b6:
>> memory32:offline removable: 0  zones: Normal Movable
>> memory33:offline removable: 0  zones: Normal Movable
>> memory34:offline removable: 0  zones: Normal Movable
>> memory35:offline removable: 0  zones: Normal Movable
> 
> did you mean _after_ the series because the bellow looks like
> the original behavior (at least valid_zones).
>  
>> // after series at commit 6a010434
>> memory32:offline removable: 1  zones: Normal
>> memory33:offline removable: 1  zones: Normal
>> memory34:offline removable: 1  zones: Normal
>> memory35:offline removable: 1  zones: Normal Movable
>>
>> also looking at #issue1 removable flag state doesn't
>> seem to be consistent between state changes but maybe that's
>> been broken before
> 
> Well, the file has a very questionable semantic. It doesn't provide
> a stable information. Anyway put that aside.
> is_pageblock_removable_nolock relies on having zone association
> which we do not have yet if the memblock is offline. So we need
> the following. I will queue this as a preparatory patch.
> ---
> From 4f3ebc02f4d552d3fe114787ca8a38cc68702208 Mon Sep 17 00:00:00 2001
> From: Michal Hocko <mhocko@...e.com>
> Date: Mon, 10 Apr 2017 17:59:03 +0200
> Subject: [PATCH] mm, memory_hotplug: consider offline memblocks removable
> 
> is_pageblock_removable_nolock relies on having zone association to
> examine all the page blocks to check whether they are movable or free.
> This is just wasting of cycles when the memblock is offline. Later patch
> in the series will also change the time when the page is associated with
> a zone so we let's bail out early if the memblock is offline.
> 
> Reported-by: Igor Mammedov <imammedo@...hat.com>
> Signed-off-by: Michal Hocko <mhocko@...e.com>

Acked-by: Vlastimil Babka <vbabka@...e.cz>

> ---
>  drivers/base/memory.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/drivers/base/memory.c b/drivers/base/memory.c
> index 9677b6b711b0..0c29ec5598ea 100644
> --- a/drivers/base/memory.c
> +++ b/drivers/base/memory.c
> @@ -128,6 +128,9 @@ static ssize_t show_mem_removable(struct device *dev,
>  	int ret = 1;
>  	struct memory_block *mem = to_memory_block(dev);
>  
> +	if (mem->stat != MEM_ONLINE)
> +		goto out;
> +
>  	for (i = 0; i < sections_per_block; i++) {
>  		if (!present_section_nr(mem->start_section_nr + i))
>  			continue;
> @@ -135,6 +138,7 @@ static ssize_t show_mem_removable(struct device *dev,
>  		ret &= is_mem_section_removable(pfn, PAGES_PER_SECTION);
>  	}
>  
> +out:
>  	return sprintf(buf, "%d\n", ret);
>  }
>  
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ