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] [day] [month] [year] [list]
Date:	Fri, 13 May 2016 10:38:20 -0700 (PDT)
From:	Yasuaki Ishimatsu <yasu.isimatu@...il.com>
To:	Reza Arbab <arbab@...ux.vnet.ibm.com>
Cc:	Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
	Andrew Morton <akpm@...ux-foundation.org>,
	Daniel Kiper <daniel.kiper@...cle.com>,
	Dan Williams <dan.j.williams@...el.com>,
	Vlastimil Babka <vbabka@...e.cz>,
	Tang Chen <tangchen@...fujitsu.com>,
	Joonsoo Kim <iamjoonsoo.kim@....com>,
	David Vrabel <david.vrabel@...rix.com>,
	Vitaly Kuznetsov <vkuznets@...hat.com>,
	David Rientjes <rientjes@...gle.com>,
	Andrew Banman <abanman@....com>,
	Chen Yucong <slaoub@...il.com>, linux-mm@...ck.org,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH 3/3] memory-hotplug: use zone_can_shift() for sysfs
 valid_zones attribute


On Mon,  9 May 2016 12:53:39 -0500
Reza Arbab <arbab@...ux.vnet.ibm.com> wrote:

> Since zone_can_shift() is being used to validate the target zone during
> onlining, it should also be used to determine the content of valid_zones.
> 
> Signed-off-by: Reza Arbab <arbab@...ux.vnet.ibm.com>
> ---

Looks good to me.

Reviewd-by: Yasuaki Ishimatsu <isimatu.yasuaki@...fujitsu.com>

Thanks,
Yasuaki Ishimatsu

>  drivers/base/memory.c | 28 +++++++++++++++++-----------
>  1 file changed, 17 insertions(+), 11 deletions(-)
> 
> diff --git a/drivers/base/memory.c b/drivers/base/memory.c
> index 31e9c61..8e385ea 100644
> --- a/drivers/base/memory.c
> +++ b/drivers/base/memory.c
> @@ -389,6 +389,7 @@ static ssize_t show_valid_zones(struct device *dev,
>  	unsigned long nr_pages = PAGES_PER_SECTION * sections_per_block;
>  	struct page *first_page;
>  	struct zone *zone;
> +	int zone_shift = 0;
>  
>  	start_pfn = section_nr_to_pfn(mem->start_section_nr);
>  	end_pfn = start_pfn + nr_pages;
> @@ -400,21 +401,26 @@ static ssize_t show_valid_zones(struct device *dev,
>  
>  	zone = page_zone(first_page);
>  
> -	if (zone_idx(zone) == ZONE_MOVABLE - 1) {
> -		/*The mem block is the last memoryblock of this zone.*/
> -		if (end_pfn == zone_end_pfn(zone))
> -			return sprintf(buf, "%s %s\n",
> -					zone->name, (zone + 1)->name);
> +	/* MMOP_ONLINE_KEEP */
> +	sprintf(buf, "%s", zone->name);
> +
> +	/* MMOP_ONLINE_KERNEL */
> +	zone_shift = zone_can_shift(start_pfn, nr_pages, ZONE_NORMAL);
> +	if (zone_shift) {
> +		strcat(buf, " ");
> +		strcat(buf, (zone + zone_shift)->name);
>  	}
>  
> -	if (zone_idx(zone) == ZONE_MOVABLE) {
> -		/*The mem block is the first memoryblock of ZONE_MOVABLE.*/
> -		if (start_pfn == zone->zone_start_pfn)
> -			return sprintf(buf, "%s %s\n",
> -					zone->name, (zone - 1)->name);
> +	/* MMOP_ONLINE_MOVABLE */
> +	zone_shift = zone_can_shift(start_pfn, nr_pages, ZONE_MOVABLE);
> +	if (zone_shift) {
> +		strcat(buf, " ");
> +		strcat(buf, (zone + zone_shift)->name);
>  	}
>  
> -	return sprintf(buf, "%s\n", zone->name);
> +	strcat(buf, "\n");
> +
> +	return strlen(buf);
>  }
>  static DEVICE_ATTR(valid_zones, 0444, show_valid_zones, NULL);
>  #endif
> -- 
> 1.8.3.1
> 
> --
> To unsubscribe, send a message with 'unsubscribe linux-mm' in
> the body to majordomo@...ck.org.  For more info on Linux MM,
> see: http://www.linux-mm.org/ .
> Don't email: <a href=mailto:"dont@...ck.org"> email@...ck.org </a>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ