linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: Keith Busch <keith.busch@intel.com>
Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org,
	Kirill Shutemov <kirill.shutemov@linux.intel.com>,
	Dave Hansen <dave.hansen@intel.com>,
	Dan Williams <dan.j.williams@intel.com>
Subject: Re: [PATCH 4/6] tools/gup_benchmark: Allow user specified file
Date: Wed, 10 Oct 2018 15:31:01 -0700	[thread overview]
Message-ID: <20181010153101.4f5dcf6dcc01e71934eeb1ba@linux-foundation.org> (raw)
In-Reply-To: <20181010195605.10689-4-keith.busch@intel.com>

On Wed, 10 Oct 2018 13:56:03 -0600 Keith Busch <keith.busch@intel.com> wrote:

> This patch allows a user to specify a file to map by adding a new option,
> '-f', providing a means to test various file backings.
> 
> If not specified, the benchmark will use a private mapping of /dev/zero,
> which produces an anonymous mapping as before.
> 
> ...
>
> --- a/tools/testing/selftests/vm/gup_benchmark.c
> +++ b/tools/testing/selftests/vm/gup_benchmark.c
>
> ...
>
> @@ -61,11 +62,18 @@ int main(int argc, char **argv)
>  		case 'w':
>  			write = 1;
>  			break;
> +		case 'f':
> +			file = optarg;
> +			break;
>  		default:
>  			return -1;
>  		}
>  	}
>  
> +	filed = open(file, O_RDWR|O_CREAT);
> +	if (filed < 0)
> +		perror("open"), exit(filed);

Ick.  Like this, please:

--- a/tools/testing/selftests/vm/gup_benchmark.c~tools-gup_benchmark-allow-user-specified-file-fix
+++ a/tools/testing/selftests/vm/gup_benchmark.c
@@ -71,8 +71,10 @@ int main(int argc, char **argv)
 	}
 
 	filed = open(file, O_RDWR|O_CREAT);
-	if (filed < 0)
-		perror("open"), exit(filed);
+	if (filed < 0) {
+		perror("open");
+		exit(filed);
+	}
 
 	gup.nr_pages_per_call = nr_pages;
 	gup.flags = write;

  reply	other threads:[~2018-10-10 22:31 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-10 19:56 [PATCH 1/6] mm/gup_benchmark: Time put_page Keith Busch
2018-10-10 19:56 ` [PATCH 2/6] mm/gup_benchmark: Add additional pinning methods Keith Busch
2018-10-10 19:56 ` [PATCH 3/6] tools/gup_benchmark: Fix 'write' flag usage Keith Busch
2018-10-10 19:56 ` [PATCH 4/6] tools/gup_benchmark: Allow user specified file Keith Busch
2018-10-10 22:31   ` Andrew Morton [this message]
2018-10-10 22:42     ` Keith Busch
2018-10-10 19:56 ` [PATCH 5/6] tools/gup_benchmark: Add MAP_SHARED option Keith Busch
2018-10-10 19:56 ` [PATCH 6/6] tools/gup_benchmark: Add MAP_HUGETLB option Keith Busch
2018-10-10 22:26 ` [PATCH 1/6] mm/gup_benchmark: Time put_page Andrew Morton
2018-10-10 22:28   ` Keith Busch
2018-10-10 22:41     ` Andrew Morton
2018-10-10 22:40       ` Keith Busch

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20181010153101.4f5dcf6dcc01e71934eeb1ba@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=dan.j.williams@intel.com \
    --cc=dave.hansen@intel.com \
    --cc=keith.busch@intel.com \
    --cc=kirill.shutemov@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox