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: <873a2s8hmp.fsf@basil.nowhere.org>
Date:	Wed, 30 Dec 2009 19:02:38 +0100
From:	Andi Kleen <andi@...stfloor.org>
To:	Wu Fengguang <fengguang.wu@...el.com>
Cc:	Andrew Morton <akpm@...ux-foundation.org>,
	Quentin Barnes <qbarnes+nfs@...oo-inc.com>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	linux-fsdevel@...r.kernel.org, Nick Piggin <npiggin@...e.de>,
	Steven Whitehouse <swhiteho@...hat.com>
Subject: Re: [RFC][PATCH 2/2] readahead: avoid page-by-page reads on POSIX_FADV_RANDOM

Wu Fengguang <fengguang.wu@...el.com> writes:
>   * the ra fields can be accessed concurrently in a racy way.
> --- linux.orig/mm/fadvise.c	2009-12-30 13:02:03.000000000 +0800
> +++ linux/mm/fadvise.c	2009-12-30 13:23:05.000000000 +0800
> @@ -77,12 +77,14 @@ SYSCALL_DEFINE(fadvise64_64)(int fd, lof
>  	switch (advice) {
>  	case POSIX_FADV_NORMAL:
>  		file->f_ra.ra_pages = bdi->ra_pages;
> +		file->f_ra.flags &= ~RA_FLAG_RANDOM;
>  		break;
>  	case POSIX_FADV_RANDOM:
> -		file->f_ra.ra_pages = 0;
> +		file->f_ra.flags |= RA_FLAG_RANDOM;

What prevents this from racing with a parallel readahead
state modification, losing the bits?

-Andi

-- 
ak@...ux.intel.com -- Speaking for myself only.
--
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