Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp6645401ybi; Sun, 21 Jul 2019 22:51:11 -0700 (PDT) X-Google-Smtp-Source: APXvYqzTEEyE+IVWE4tgXEM+jW4Gk3j5n0+kiHHOLn7bZdIL5Pn2+PkWNChIATElCHPQ851c2TDo X-Received: by 2002:a17:90a:ba93:: with SMTP id t19mr74121932pjr.139.1563774671799; Sun, 21 Jul 2019 22:51:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563774671; cv=none; d=google.com; s=arc-20160816; b=MMRBgIKIkbgJBgzQU4zNJKB6e8QRQaepKIoyl7o0CItclUpkhThv7AF2d1PDke37id tXY7QBaDQVEkVZ7VJdlxB7DPFG9R+7edbgUlhRPZ3mvhbTe5KnmAVpGpKKph6QiL8Pty 8IzubXViRxzBlczmos4FTOrKZnKUqkOkCdWqKIk9zLJrVjgUXPZ8s9rowWKiJ+Zzxvag tGRcSc2VVLP3l+nSdnYnGd1vnuHkIDlscqux+VguypJEnKSHH0XeeDpuIKujrFF4ks9c qEUqQacS2TQJzfawM8DoGks6M+EG5jxEf3v8pqrqiJQrlMMiYIWTsK7XLWw/BN2+Xw+A qXqw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:date:cc:to:from:subject:message-id :dkim-signature:dkim-signature; bh=8UjSjqSehza3/UezqmCdyVeuGiUCa6HW3r4Ov5IzwmY=; b=EZbmDj9T0FayeDkv26bj1wHuSIZ3Ekb/nkM/Y+JQROqhIW+GusLpc7vUrGj++N4WJp aceRKkafoxN6LTOetuc1nBlBN+Oc/2+8tsBRdG9pyGi0iC+Yh1qbBku3dOs2pnHJsIPR I4HsEUK6NcQn7cWhhR9z5qnhXPgjpgC2pOuqKzkEtZWC0+HtJdRN9cZXHBzrrli8OoXE 8Hq3xXRgyRobrlEm9+i8T57d5tBzAENA0BBR9BatyErwuq3Y6OAQPehu1W+91iZ8bZTh daRukGL3b+ahQUmGwWFIsBb6wV2gAq7N+4PXcHIkps3+4sEnfG+Li1q2TY/m3PQjbohU N6Yg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@hansenpartnership.com header.s=20151216 header.b=DDMGmbII; dkim=fail header.i=@hansenpartnership.com header.s=20151216 header.b=hmohQ8vQ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=hansenpartnership.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k133si8081277pgc.425.2019.07.21.22.50.55; Sun, 21 Jul 2019 22:51:11 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@hansenpartnership.com header.s=20151216 header.b=DDMGmbII; dkim=fail header.i=@hansenpartnership.com header.s=20151216 header.b=hmohQ8vQ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=hansenpartnership.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727364AbfGVFs7 (ORCPT + 99 others); Mon, 22 Jul 2019 01:48:59 -0400 Received: from bedivere.hansenpartnership.com ([66.63.167.143]:34170 "EHLO bedivere.hansenpartnership.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726534AbfGVFs7 (ORCPT ); Mon, 22 Jul 2019 01:48:59 -0400 Received: from localhost (localhost [127.0.0.1]) by bedivere.hansenpartnership.com (Postfix) with ESMTP id 68A4C8EE105; Sun, 21 Jul 2019 22:48:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=hansenpartnership.com; s=20151216; t=1563774538; bh=GBzZx34QSvoUf46NUopxvz+NmUwMBdn/Sm7BLWdcBQM=; h=Subject:From:To:Cc:Date:In-Reply-To:References:From; b=DDMGmbIIE7cXvWSaDtPNEZfsdYQ5a9sfvOgssv1x1PJRgbyuuXrL1Gj5Yo56efQP4 1a2V0nIiExrlNQbL3ZilUg57AumScNiclBDj+vR4chedEzKLEnsRKYgFfKLRMhpkMA 3KZvivm6SzmoWmlwl8oUbf4n0Nt1Smymj/pDsIPU= Received: from bedivere.hansenpartnership.com ([127.0.0.1]) by localhost (bedivere.hansenpartnership.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 5x5v_jQuitfc; Sun, 21 Jul 2019 22:48:56 -0700 (PDT) Received: from [192.168.222.203] (skyclub2.st.wakwak.ne.jp [61.115.125.222]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by bedivere.hansenpartnership.com (Postfix) with ESMTPSA id 1A52E8EE104; Sun, 21 Jul 2019 22:48:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=hansenpartnership.com; s=20151216; t=1563774533; bh=GBzZx34QSvoUf46NUopxvz+NmUwMBdn/Sm7BLWdcBQM=; h=Subject:From:To:Cc:Date:In-Reply-To:References:From; b=hmohQ8vQZcJdtFuOH9l0Hs/MQzRIFEzWkuIbLL2sdkQRzrcfrkczy2dR1hECCKunO MwXBMiE1bOQ/U9p33Lso5bF7g3YyrZPbhShQOmn6B8fK23Xto4X0yID+eMC4DVYnOe paeyWEzydvDxiCrUSVNpKNqtC4hF5wtG/AKaj9Fg= Message-ID: <1563774526.3223.2.camel@HansenPartnership.com> Subject: Re: [PATCH] unaligned: delete 1-byte accessors From: James Bottomley To: Alexey Dobriyan Cc: akpm@linux-foundation.org, linux-kernel@vger.kernel.org, netdev@vger.kernel.org, axboe@kernel.dk, kvalo@codeaurora.org, john.johansen@canonical.com, linux-arch@vger.kernel.org Date: Mon, 22 Jul 2019 14:48:46 +0900 In-Reply-To: <20190722052244.GA4235@avx2> References: <20190721215253.GA18177@avx2> <1563750513.2898.4.camel@HansenPartnership.com> <20190722052244.GA4235@avx2> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.26.6 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 2019-07-22 at 08:22 +0300, Alexey Dobriyan wrote: > On Mon, Jul 22, 2019 at 08:08:33AM +0900, James Bottomley wrote: > > On Mon, 2019-07-22 at 00:52 +0300, Alexey Dobriyan wrote: > > > Each and every 1-byte access is aligned! > > > > The design idea of this is for parsing descriptors. We simply > > chunk up the describing structure using get_unaligned for > > everything. The reason is because a lot of these structures come > > with reserved areas which we may make use of later. If we're using > > get_unaligned for everything we can simply change a u8 to a u16 in > > the structure absorbing the reserved padding. With your change now > > I'd have to chase down every byte access and replace it with > > get_unaligned instead of simply changing the structure. > > > > What's the significant advantage of this change that compensates > > for the problems the above causes? > > HW descriptors have fixed endianness, you're supposed to use > get_unaligned_be32() and friends. Not if this is an internal descriptor format, which is what this is mostly used for. > For that matter, drivers/scsi/ has exactly 2 get_unaligned() calls > one of which can be changed to get_unaligned_be32(). You haven't answered the "what is the benefit of this change" question. I mean sure we can do it, but it won't make anything more efficient and it does help with the descriptor format to treat every structure field the same. James