Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752581AbdHBIwc (ORCPT ); Wed, 2 Aug 2017 04:52:32 -0400 Received: from mga11.intel.com ([192.55.52.93]:4729 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752245AbdHBIwb (ORCPT ); Wed, 2 Aug 2017 04:52:31 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.41,310,1498546800"; d="scan'208";a="294597193" From: "Huang, Ying" To: Peter Zijlstra Cc: linux-kernel@vger.kernel.org, Tejun Heo , Christoph Lameter , Joerg Roedel , Ingo Molnar , Michael Ellerman , Borislav Petkov , Thomas Gleixner , Juergen Gross , Aaron Lu , Huang Ying Subject: [PATCH 0/3] IPI: Avoid to use 2 cache lines for one call_single_data Date: Wed, 2 Aug 2017 16:52:17 +0800 Message-Id: <20170802085220.4315-1-ying.huang@intel.com> X-Mailer: git-send-email 2.13.2 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1071 Lines: 22 From: Huang Ying struct call_single_data is used in IPI to transfer information between CPUs. Its size is bigger than sizeof(unsigned long) and less than cache line size. Now, it is allocated with no any alignment requirement. This makes it possible for allocated call_single_data to cross 2 cache lines. So that double the number of the cache lines that need to be transferred among CPUs. This is resolved by aligning the allocated call_single_data with cache line size. To allocate cache line size aligned percpu memory dynamically, alloc_percpu_aligned() is introduced and used in iova drivers too. To test the effect of the patch, we use the vm-scalability multiple thread swap test case (swap-w-seq-mt). The test will create multiple threads and each thread will eat memory until all RAM and part of swap is used, so that huge number of IPI will be triggered when unmapping memory. In the test, the throughput of memory writing improves ~5% compared with misaligned call_single_data because of faster IPI. Best Regards, Huang, Ying