From patchwork Thu Aug 24 07:03:42 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Omar Sandoval X-Patchwork-Id: 9919141 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 8110E60327 for ; Thu, 24 Aug 2017 07:03:56 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 71E6C28B48 for ; Thu, 24 Aug 2017 07:03:56 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 66FF228B51; Thu, 24 Aug 2017 07:03:56 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.4 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0DF6F28B48 for ; Thu, 24 Aug 2017 07:03:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751256AbdHXHDz (ORCPT ); Thu, 24 Aug 2017 03:03:55 -0400 Received: from mail-pg0-f46.google.com ([74.125.83.46]:38808 "EHLO mail-pg0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751183AbdHXHDz (ORCPT ); Thu, 24 Aug 2017 03:03:55 -0400 Received: by mail-pg0-f46.google.com with SMTP id m133so12451729pga.5 for ; Thu, 24 Aug 2017 00:03:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=osandov-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references; bh=6k6MhNZ/RqIXU6aZJXF3YJV4Qpi0vVvNxqmE7Ty7S4M=; b=Nr5FVgVcLYQVBuoSB0Jk08DI8xAFdpCc+0Z1PaDGU1EPxUDxmxxOjgmR1+0P4Q3giz GqTsf5h55PKHBDWdguK2sxh56mOu259Amoth7081uyb7HoMfT1a7rpHph9NqMUmefwtu uU8fLyUhXPzJbTsg8wPofcrocmAd3O3e+z4x6EPeyUi76yuZ5jMUjNHEU5XMtxfQ4QXk NKRfH4GB4ZtA+xd1l92yvj78oFdjMsI0JE5o4/T7nE9PegkZKLymJF6saqUebqqL3vZ1 Pvxo1BGWH1s4wCgpjspwFxjSOmLGssYEhlw+rOUPH77XkD9xV/CDgEkF075xyzW1Wa0V I7Yg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:in-reply-to:references; bh=6k6MhNZ/RqIXU6aZJXF3YJV4Qpi0vVvNxqmE7Ty7S4M=; b=aIdF2Du8333zdTWfPRxqwXvdq57SZXkuT+btC90JfYezhc+er0WfIeYRp+5a2ebaca moU+AgEwZwwLJPEzVaM3tfkVVTY1KO7fJG/n/63ZhipCPvHawTR3c9atK4dz9+crAA5i rzj4c79Z34hQPOmO3dcgrYYfwq4u/G+tRjvqk3nL2gfkHZJMHSyU821KxsS2cS4tsPaX H8sHgjXpWowFvq17e6NM3KXBdYUKM726HyIkzrr/ADd6kVoLzIo3D4fj1GNVplxAU376 +LxMtiU5jTKZKtRYZfqNdCFskkyx4oUOv2IRwoxiThjfn7B5c3nvL7n0DcT948un4xOw Q/Bg== X-Gm-Message-State: AHYfb5iEekNZH6UOC4O7M/+v/B9H/axGPqfahMBGQX62WqxSqmCC2ANR 4K8nOSuwMBCr5cx75mH3iA== X-Received: by 10.98.141.70 with SMTP id z67mr5410644pfd.289.1503558234194; Thu, 24 Aug 2017 00:03:54 -0700 (PDT) Received: from vader.thefacebook.com ([2620:10d:c090:180::1:90fd]) by smtp.gmail.com with ESMTPSA id g2sm6187459pgu.86.2017.08.24.00.03.53 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 24 Aug 2017 00:03:53 -0700 (PDT) From: Omar Sandoval To: linux-block@vger.kernel.org Cc: kernel-team@fb.com, Hannes Reinecke , Ming Lei , Karel Zak , Milan Broz Subject: [PATCH 2/4] loop: set physical block size to PAGE_SIZE Date: Thu, 24 Aug 2017 00:03:42 -0700 Message-Id: <378ae3760bd37441fd60a5188eae75f39babb6aa.1503558155.git.osandov@fb.com> X-Mailer: git-send-email 2.14.1 In-Reply-To: References: In-Reply-To: References: Sender: linux-block-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Omar Sandoval The physical block size is "the lowest possible sector size that the hardware can operate on without reverting to read-modify-write operations" (from the comment on blk_queue_physical_block_size()). Since loop does buffered I/O on the backing file by default, the RMW unit is a page. This isn't the case for direct I/O mode, but let's keep it simple. Signed-off-by: Omar Sandoval Reviewed-by: Hannes Reinecke --- drivers/block/loop.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/block/loop.c b/drivers/block/loop.c index 54e091887199..1a5b4ecf54ec 100644 --- a/drivers/block/loop.c +++ b/drivers/block/loop.c @@ -1764,6 +1764,8 @@ static int loop_add(struct loop_device **l, int i) } lo->lo_queue->queuedata = lo; + blk_queue_physical_block_size(lo->lo_queue, PAGE_SIZE); + /* * It doesn't make sense to enable merge because the I/O * submitted to backing file is handled page by page.