From: Kirill Tkhai <ktkhai@virtuozzo.com>
To: Chaitanya Kulkarni <Chaitanya.Kulkarni@wdc.com>,
"linux-block@vger.kernel.org" <linux-block@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"linux-ext4@vger.kernel.org" <linux-ext4@vger.kernel.org>
Cc: "axboe@kernel.dk" <axboe@kernel.dk>,
"tytso@mit.edu" <tytso@mit.edu>,
"adilger.kernel@dilger.ca" <adilger.kernel@dilger.ca>,
"ming.lei@redhat.com" <ming.lei@redhat.com>,
"osandov@fb.com" <osandov@fb.com>,
"jthumshirn@suse.de" <jthumshirn@suse.de>,
"minwoo.im.dev@gmail.com" <minwoo.im.dev@gmail.com>,
Damien Le Moal <Damien.LeMoal@wdc.com>,
"andrea.parri@amarulasolutions.com"
<andrea.parri@amarulasolutions.com>,
"hare@suse.com" <hare@suse.com>, "tj@kernel.org" <tj@kernel.org>,
Ajay Joshi <Ajay.Joshi@wdc.com>,
"sagi@grimberg.me" <sagi@grimberg.me>,
"dsterba@suse.com" <dsterba@suse.com>,
"bvanassche@acm.org" <bvanassche@acm.org>,
"dhowells@redhat.com" <dhowells@redhat.com>,
"asml.silence@gmail.com" <asml.silence@gmail.com>
Subject: Re: [PATCH RFC 0/3] block,ext4: Introduce REQ_OP_ASSIGN_RANGE to reflect extents allocation in block device internals
Date: Wed, 11 Dec 2019 11:50:52 +0300 [thread overview]
Message-ID: <a96e7af6-a807-1ca9-af50-4e0a7d771ac8@virtuozzo.com> (raw)
In-Reply-To: <BYAPR04MB574961FE921EB3FEA03CAF77865A0@BYAPR04MB5749.namprd04.prod.outlook.com>
On 11.12.2019 10:42, Chaitanya Kulkarni wrote:
>> Here is a simple test I did:
>> https://gist.github.com/tkhai/5b788651cdb74c1dbff3500745878856
>>
>
> Somehow I'm not able to open this link, can you please share results
> in plain text on the email ?
#define _GNU_SOURCE
#include <sys/types.h>
#include <unistd.h>
#include <stdlib.h>
#include <stdio.h>
#include <fcntl.h>
#include <errno.h>
#define BLOCK_SIZE 4096
#define STEP (BLOCK_SIZE * 16)
#define SIZE (4ULL * 1024 * 1024 * 1024)
int main(int argc)
{
int fd, step, ret = 0;
unsigned long i;
void *buf;
if (posix_memalign(&buf, BLOCK_SIZE, SIZE)) {
perror("alloc");
exit(1);
}
fd = open("file2.img", O_RDWR|O_CREAT|O_DIRECT);
if (fd < 0) {
perror("open");
exit(1);
}
if (ftruncate(fd, SIZE)) {
perror("ftruncate");
exit(1);
}
ret = fallocate(fd, 0, 0, SIZE);
if (ret) {
perror("fallocate");
exit(1);
}
for (step = STEP - BLOCK_SIZE; step >= 0; step -= BLOCK_SIZE) {
printf("step=%u\n", step);
for (i = step; i < SIZE; i += STEP) {
errno = 0;
if (pwrite(fd, buf, BLOCK_SIZE, i) != BLOCK_SIZE) {
perror("pwrite");
exit(1);
}
}
if (fsync(fd)) {
perror("fsync");
exit(1);
}
}
return 0;
}
next prev parent reply other threads:[~2019-12-11 8:51 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-12-10 16:56 [PATCH RFC 0/3] block,ext4: Introduce REQ_OP_ASSIGN_RANGE to reflect extents allocation in block device internals Kirill Tkhai
2019-12-10 16:56 ` [PATCH RFC 1/3] block: Add support for REQ_OP_ASSIGN_RANGE operation Kirill Tkhai
2019-12-19 3:03 ` Martin K. Petersen
2019-12-19 11:07 ` Kirill Tkhai
2019-12-19 22:03 ` Chaitanya Kulkarni
2019-12-19 22:37 ` Martin K. Petersen
2019-12-20 1:53 ` Darrick J. Wong
2019-12-20 2:22 ` Martin K. Petersen
2019-12-20 11:55 ` Kirill Tkhai
2019-12-21 18:54 ` Martin K. Petersen
2019-12-23 8:51 ` Kirill Tkhai
2020-01-07 3:24 ` Martin K. Petersen
2020-01-07 13:59 ` Kirill Tkhai
2020-01-08 2:49 ` Martin K. Petersen
2020-01-09 9:43 ` Kirill Tkhai
2019-12-10 16:56 ` [PATCH RFC 2/3] loop: Forward REQ_OP_ASSIGN_RANGE into fallocate(0) Kirill Tkhai
2019-12-10 16:56 ` [PATCH RFC 3/3] ext4: Notify block device about fallocate(0)-assigned blocks Kirill Tkhai
2019-12-11 12:55 ` [PATCH RFC v2 " Kirill Tkhai
2019-12-11 7:42 ` [PATCH RFC 0/3] block,ext4: Introduce REQ_OP_ASSIGN_RANGE to reflect extents allocation in block device internals Chaitanya Kulkarni
2019-12-11 8:50 ` Kirill Tkhai [this message]
2019-12-17 14:16 ` Kirill Tkhai
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=a96e7af6-a807-1ca9-af50-4e0a7d771ac8@virtuozzo.com \
--to=ktkhai@virtuozzo.com \
--cc=Ajay.Joshi@wdc.com \
--cc=Chaitanya.Kulkarni@wdc.com \
--cc=Damien.LeMoal@wdc.com \
--cc=adilger.kernel@dilger.ca \
--cc=andrea.parri@amarulasolutions.com \
--cc=asml.silence@gmail.com \
--cc=axboe@kernel.dk \
--cc=bvanassche@acm.org \
--cc=dhowells@redhat.com \
--cc=dsterba@suse.com \
--cc=hare@suse.com \
--cc=jthumshirn@suse.de \
--cc=linux-block@vger.kernel.org \
--cc=linux-ext4@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=ming.lei@redhat.com \
--cc=minwoo.im.dev@gmail.com \
--cc=osandov@fb.com \
--cc=sagi@grimberg.me \
--cc=tj@kernel.org \
--cc=tytso@mit.edu \
/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;
as well as URLs for NNTP newsgroup(s).