From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.2 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 44CF9C43603 for ; Wed, 11 Dec 2019 08:51:58 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 24D9720652 for ; Wed, 11 Dec 2019 08:51:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728368AbfLKIvy (ORCPT ); Wed, 11 Dec 2019 03:51:54 -0500 Received: from relay.sw.ru ([185.231.240.75]:37430 "EHLO relay.sw.ru" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726845AbfLKIvy (ORCPT ); Wed, 11 Dec 2019 03:51:54 -0500 Received: from dhcp-172-16-24-104.sw.ru ([172.16.24.104]) by relay.sw.ru with esmtp (Exim 4.92.3) (envelope-from ) id 1iexhs-000496-Vm; Wed, 11 Dec 2019 11:50:53 +0300 Subject: Re: [PATCH RFC 0/3] block,ext4: Introduce REQ_OP_ASSIGN_RANGE to reflect extents allocation in block device internals To: Chaitanya Kulkarni , "linux-block@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "linux-ext4@vger.kernel.org" Cc: "axboe@kernel.dk" , "tytso@mit.edu" , "adilger.kernel@dilger.ca" , "ming.lei@redhat.com" , "osandov@fb.com" , "jthumshirn@suse.de" , "minwoo.im.dev@gmail.com" , Damien Le Moal , "andrea.parri@amarulasolutions.com" , "hare@suse.com" , "tj@kernel.org" , Ajay Joshi , "sagi@grimberg.me" , "dsterba@suse.com" , "bvanassche@acm.org" , "dhowells@redhat.com" , "asml.silence@gmail.com" References: <157599668662.12112.10184894900037871860.stgit@localhost.localdomain> From: Kirill Tkhai Message-ID: Date: Wed, 11 Dec 2019 11:50:52 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.9.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org 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 #include #include #include #include #include #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; }