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: <28c262360902250013q7c2151c3x4bb093509b065fe0@mail.gmail.com>
Date:	Wed, 25 Feb 2009 17:13:36 +0900
From:	MinChan Kim <minchan.kim@...il.com>
To:	Johannes Weiner <hannes@...xchg.org>
Cc:	Andrew Morton <akpm@...ux-foundation.org>, linux-mm@...ck.org,
	linux-kernel@...r.kernel.org
Subject: Re: [patch] mm: move pagevec stripping to save unlock-relock

Nice catch!

Reviewed-by: MinChan Kim <minchan.kim@...il.com>

On Wed, Feb 25, 2009 at 11:38 AM, Johannes Weiner <hannes@...xchg.org> wrote:
> In shrink_active_list() after the deactivation loop, we strip buffer
> heads from the potentially remaining pages in the pagevec.
>
> Currently, this drops the zone's lru lock for stripping, only to
> reacquire it again afterwards to update statistics.
>
> It is not necessary to strip the pages before updating the stats, so
> move the whole thing out of the protected region and save the extra
> locking.
>
> Signed-off-by: Johannes Weiner <hannes@...xchg.org>
> ---
>  mm/vmscan.c |    7 ++-----
>  1 file changed, 2 insertions(+), 5 deletions(-)
>
> --- a/mm/vmscan.c
> +++ b/mm/vmscan.c
> @@ -1298,14 +1298,11 @@ static void shrink_active_list(unsigned
>        }
>        __mod_zone_page_state(zone, NR_LRU_BASE + lru, pgmoved);
>        pgdeactivate += pgmoved;
> -       if (buffer_heads_over_limit) {
> -               spin_unlock_irq(&zone->lru_lock);
> -               pagevec_strip(&pvec);
> -               spin_lock_irq(&zone->lru_lock);
> -       }
>        __count_zone_vm_events(PGREFILL, zone, pgscanned);
>        __count_vm_events(PGDEACTIVATE, pgdeactivate);
>        spin_unlock_irq(&zone->lru_lock);
> +       if (buffer_heads_over_limit)
> +               pagevec_strip(&pvec);
>        if (vm_swap_full())
>                pagevec_swap_free(&pvec);
>
>
> --
> 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>
>



-- 
Kinds regards,
MinChan Kim
--
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