From patchwork Wed Dec 20 19:34:55 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jens Axboe X-Patchwork-Id: 10126459 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 484B360390 for ; Wed, 20 Dec 2017 19:34:59 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3683F29827 for ; Wed, 20 Dec 2017 19:34:59 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2A5DD2983F; Wed, 20 Dec 2017 19:34:59 +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.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_HI 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 9B80C29827 for ; Wed, 20 Dec 2017 19:34:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755557AbdLTTe6 (ORCPT ); Wed, 20 Dec 2017 14:34:58 -0500 Received: from mail-io0-f196.google.com ([209.85.223.196]:34482 "EHLO mail-io0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755534AbdLTTe5 (ORCPT ); Wed, 20 Dec 2017 14:34:57 -0500 Received: by mail-io0-f196.google.com with SMTP id f18so13440122ioh.1 for ; Wed, 20 Dec 2017 11:34:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel-dk.20150623.gappssmtp.com; s=20150623; h=to:from:subject:message-id:date:user-agent:mime-version :content-language:content-transfer-encoding; bh=9NcjD4M+1LZZPD56ANB5AzpLKmV2VinrlncUihB04Sc=; b=kEqhQ7Pnz7uuabDDUc0YWGTelKdpSSctQUOftsgyexlri7BhbjY3P7Cwp2FBPZ0MWU bJ1fRvc3wmnUiCC3aTJjll3F99MTSzFW+v0+mHASL9HzhmqtNQj0BijDqM8trV+diqrs omJ/GNOAtq7KR8i/QfzaZ01+Tn00YCjG3G+1SQmr6toKm4PYX0zzuvyish9GEBGotS3c IyCyO+Nv6kWAJF9XXWWTdy88FcSnZpsanHiUN0+aiVdOqHH8mI2JPLW6RQT0Va3GLwyg tRqB+eZxS95R3SnYH7XUEUwAR4xFswR2qyXfrIJVbAz6F94pBMjeFJtA0YRgYagXXl7O +DEw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:to:from:subject:message-id:date:user-agent :mime-version:content-language:content-transfer-encoding; bh=9NcjD4M+1LZZPD56ANB5AzpLKmV2VinrlncUihB04Sc=; b=prlYH5vmY/H1rr3erLSd43F0zlDgcTPAH3tYxcsPYWL20CRno4HFlLg0ctWzJUkhcd YoVXwBnfvBZZu51bj9EC5jAqMrpnrUJd8BFInRd50ZVU/88w8X91zx3bWlcyqhdI1Cky +BHFy1zCoHDkpc71sK7ziHGQgUUNEJqETAyk6iSCJp1VAYkZSLsKsE/qZmOPJFzAUI3u zfKrb/d2sIYfU1xdymLpZd9k/MQARX4l1a0MElE4rQZwbj4RQMI04xD1JEADRooEBymn AfJLkv0MxbqmeRoo8gzLP3H9bj1fJBAmudOVF1LxrAkkloE92CH7ojKEA5UFIU+mZWkW 8MYQ== X-Gm-Message-State: AKGB3mIZCwrkhE+yqBnRi8nHQ4nk2S/6FnZWusqopzPBXp2k/uJh/ntq +XKSjKGvb5p6+JnSCjeNO7J6EvApLx0= X-Google-Smtp-Source: ACJfBotiFkrnfsu8g6I8NANkaQgVgKSj19pjioPJEvtzcB37h7e+5FFtn0l5aI8QoPuS4gdtBrBnUg== X-Received: by 10.107.174.198 with SMTP id n67mr10058402ioo.18.1513798496731; Wed, 20 Dec 2017 11:34:56 -0800 (PST) Received: from [192.168.1.154] ([216.160.245.98]) by smtp.gmail.com with ESMTPSA id l129sm5984770ioa.77.2017.12.20.11.34.56 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 20 Dec 2017 11:34:56 -0800 (PST) To: "linux-block@vger.kernel.org" From: Jens Axboe Subject: [PATCH] null_blk: unalign call_single_data Message-ID: Date: Wed, 20 Dec 2017 12:34:55 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:57.0) Gecko/20100101 Thunderbird/57.0 MIME-Version: 1.0 Content-Language: en-US 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 Commit 966a967116e6 randomly added alignment to this structure, but it's actually detrimental to performance of null_blk. Test case: # modprobe null_blk queue_mode=1 irqmode=1 home_node={0,1} # echo noop > /sys/block/nullb0/queue/scheduler # fio --name=csd --filename=/dev/nullb0 --numjobs=8 --direct=1 --rw=randread --norandommap --cpus_allowed=$(cat /sys/devices/system/node/node0/cpulist) --group_reporting=1 Running on both the home and remote node shows a ~5% degradation in performance. Fixes: 966a967116e69 ("smp: Avoid using two cache lines for struct call_single_data") Signed-off-by: Jens Axboe diff --git a/drivers/block/null_blk.c b/drivers/block/null_blk.c index ccb9975a97fa..8c6912dd5142 100644 --- a/drivers/block/null_blk.c +++ b/drivers/block/null_blk.c @@ -35,7 +35,7 @@ static inline u64 mb_per_tick(int mbps) struct nullb_cmd { struct list_head list; struct llist_node ll_list; - call_single_data_t csd; + struct __call_single_data csd; struct request *rq; struct bio *bio; unsigned int tag;