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: <01c9e2c9-3a04-48cd-cf0e-265db33d1a24@suse.cz>
Date:   Wed, 4 Jan 2017 15:51:43 +0100
From:   Vlastimil Babka <vbabka@...e.cz>
To:     Michal Hocko <mhocko@...nel.org>,
        Andrew Morton <akpm@...ux-foundation.org>
Cc:     Mel Gorman <mgorman@...e.de>, Johannes Weiner <hannes@...xchg.org>,
        Minchan Kim <minchan@...nel.org>,
        Hillf Danton <hillf.zj@...baba-inc.com>, linux-mm@...ck.org,
        LKML <linux-kernel@...r.kernel.org>,
        Michal Hocko <mhocko@...e.com>
Subject: Re: [PATCH 5/7] mm, vmscan: extract shrink_page_list reclaim counters
 into a struct

On 01/04/2017 11:19 AM, Michal Hocko wrote:
> From: Michal Hocko <mhocko@...e.com>
> 
> shrink_page_list returns quite some counters back to its caller. Extract
> the existing 5 into struct reclaim_stat because this makes the code
> easier to follow and also allows further counters to be returned.
> 
> While we are at it, make all of them unsigned rather than unsigned long
> as we do not really need full 64b for them (we never scan more than
> SWAP_CLUSTER_MAX pages at once). This should reduce some stack space.
> 
> This patch shouldn't introduce any functional change.

[...]

> @@ -1266,11 +1270,13 @@ static unsigned long shrink_page_list(struct list_head *page_list,
>  	list_splice(&ret_pages, page_list);
>  	count_vm_events(PGACTIVATE, pgactivate);
>  
> -	*ret_nr_dirty += nr_dirty;
> -	*ret_nr_congested += nr_congested;
> -	*ret_nr_unqueued_dirty += nr_unqueued_dirty;
> -	*ret_nr_writeback += nr_writeback;
> -	*ret_nr_immediate += nr_immediate;
> +	if (stat) {
> +		stat->nr_dirty = nr_dirty;
> +		stat->nr_congested = nr_congested;
> +		stat->nr_unqueued_dirty = nr_unqueued_dirty;
> +		stat->nr_writeback = nr_writeback;
> +		stat->nr_immediate = nr_immediate;
> +	}

This change of '+=' to '=' raised my eybrows, but it seems both callers
don't care so this is indeed no functional change and potentially faster.


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ