Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp233984pxb; Wed, 4 Nov 2020 21:03:52 -0800 (PST) X-Google-Smtp-Source: ABdhPJy+G0nBpXfGyCkTm8KXBn0tXY5asVsxIxFlGcRtBGzfjqo81fe6Qn0H4Ao2nJmVWPn/gBEH X-Received: by 2002:a17:906:6d89:: with SMTP id h9mr583846ejt.152.1604552631901; Wed, 04 Nov 2020 21:03:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604552631; cv=none; d=google.com; s=arc-20160816; b=Cer1/fXNjorqiZmTgA+3GDdwIOZ+loRbP5K9jRqvH9VnHy+9A49eGoHvFikBqMkUwB nbrFml2h+2vaOE1nz/DLLwPncHEYW7Bih/txdGYXpvZ5LYC+NdlHjSg0+u/3lF/2kBZ5 e5z2IfXfyV9cR3WVkhjx7rglDxwU+bV90Ek9CL3IopiMiZZQ75IkSyOaLDMsJqjcrIxz mm9axCSpGrxW30toZkyzhF48aL/Aql8mlEg8GRTqWG0Os5OWGFv9UPQkNvjWSDqhc/p8 BwvjgBNoh8FwQ7Y6uTQOV7+LcyEegg/nsdTSJ47JpOqp2cimOPE2c/8qpwoHdtB2R/Nq X9Og== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-language:content-transfer-encoding :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=p01AHEKh5E8r7noLWT+kIHXAQKyoQ/TUkAAZi622vws=; b=XEG9twDrk/+9sOwcmPswGL7xqVMsSJVHtnPC5qM6fw2KQY7+leyaTBImkgzUrJ0/8B T7c1mHqxUEwNgZZLg8HiLQeUvGaCe5zuIf4wa7Mifru+um3/ma2XbYYkof6Oa44ripG1 PQGhKTrmSgyIEO5Ck4YK8oKAbfQblojXQxjEiq3ugCL/hqiz7i//19w/NqA4/sE7rH6q VvnUaUbR2E17KYF9lBRy/zHBxtvt76pRqjsyD1AgppUhVJUc5awzeVUbif3U8+cUjSDc l6KY9eV8yQfUCxXUSKklzSBLPeAnMPJt3Rwn5G6Fu/+Jt+5M37UUFki2yrtI0JKNx7aM +9aQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=WMBFtsnE; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id q22si343694ejj.141.2020.11.04.21.03.29; Wed, 04 Nov 2020 21:03:51 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=WMBFtsnE; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387472AbgKEDaL (ORCPT + 99 others); Wed, 4 Nov 2020 22:30:11 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:36243 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728511AbgKEDaK (ORCPT ); Wed, 4 Nov 2020 22:30:10 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1604547008; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=p01AHEKh5E8r7noLWT+kIHXAQKyoQ/TUkAAZi622vws=; b=WMBFtsnErlE6OcxyOt+dli1Rs+lBgBZy7JT7jS1t9hdCiQCFqLD7W1K9wClsUYWCaaSKgP 343hiiSCq+wNnmqlDkgZTQiUue9nno4xTSTvvDKvhI7mANAMNw4wrSCBTMSlrEFke+LWE/ +Gf6zx2Or/Oo11NrnCO5mumYT1ozmNU= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-62-vQAbCiAuN2yGQvAqZN4Zdg-1; Wed, 04 Nov 2020 22:30:04 -0500 X-MC-Unique: vQAbCiAuN2yGQvAqZN4Zdg-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 9DC9557090; Thu, 5 Nov 2020 03:30:03 +0000 (UTC) Received: from localhost.localdomain (ovpn-8-30.pek2.redhat.com [10.72.8.30]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2BB259F64; Thu, 5 Nov 2020 03:30:00 +0000 (UTC) Subject: Re: [PATCH v2 0/3] md superblock write alignment on 512e devices To: Chris Unkel Cc: linux-raid , Song Liu , Christoph Hellwig , open list References: <20201029201358.29181-1-cunkel@drivescale.com> <265efd48-b0c6-cba5-c77e-5efb0e6b9e00@redhat.com> From: Xiao Ni Message-ID: Date: Thu, 5 Nov 2020 11:29:58 +0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 11/04/2020 04:12 AM, Chris Unkel wrote: > Hi Xiao, > > Thanks for the excellent feedback. Since bitmap_offset appears to be > a free-form field, it wasn't apparent to me that the bitmap never > starts within 4K of the bitmap. > > I don't think it's worth worrying about a logical block size that's > more than 4K here--from what I can see logical block size larger than > the usual 4K page isn't going to happen. > > I do think that it makes sense to handle the case where the physical > block size is more than 4K. I think what you propose works, but I > think in the physical block > MAX_SB_SIZE case it makes more sense to > align the superblock writes to the physical block size (as now) rather Is it a typo error? You want to say if physical block > MAX_SB_SIZE, it should align the superblock writes to logical block size? Because I see the comments below, your solution is to align to logical block size when physical block > MAX_SB_SIZE. > than rejecting the create/assemble. Mounting with the possible > performance hit seems like a better outcome for the user in that case > than refusing to assemble. > It's the same check that would have to be written to reject the > assembly in that case and so the code shouldn't really be any more > complex. > > So basically what I propose is: if the physical block size is no > larger than MAX_SB_SIZE, pad to that; otherwise pad to to > logical_block_size, that is, replace queue_logical_block_size() > with something equivalent to: > > queue_physical_block_size(...) > MAX_SB_SIZE ? > queue_logical_block_size(...) : queue_physical_block_size(...) > > which is simple, safe in all cases, doesn't reject any feasible > assembly, and generates aligned sb writes on all common current > devices (512n,4kn,512e.) > > What do you think? Yes, It's a nice solution :) Regards Xiao