From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751968AbdJESBj (ORCPT ); Thu, 5 Oct 2017 14:01:39 -0400 Received: from mx1.redhat.com ([209.132.183.28]:59826 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751921AbdJESB3 (ORCPT ); Thu, 5 Oct 2017 14:01:29 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 4F1077E457 Authentication-Results: ext-mx03.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx03.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=longman@redhat.com Subject: Re: [PATCH v6 4/6] lib/dlock-list: Make sibling CPUs share the same linked list To: Davidlohr Bueso Cc: Alexander Viro , Jan Kara , Jeff Layton , "J. Bruce Fields" , Tejun Heo , Christoph Lameter , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, Ingo Molnar , Peter Zijlstra , Andi Kleen , Dave Chinner , Boqun Feng , Waiman Long References: <1507152007-28753-1-git-send-email-longman@redhat.com> <1507152007-28753-5-git-send-email-longman@redhat.com> <20171005174004.GB5131@linux-80c1.suse> From: Waiman Long Organization: Red Hat Message-ID: Date: Thu, 5 Oct 2017 14:01:27 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.0 MIME-Version: 1.0 In-Reply-To: <20171005174004.GB5131@linux-80c1.suse> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Content-Language: en-US X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Thu, 05 Oct 2017 18:01:29 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 10/05/2017 01:40 PM, Davidlohr Bueso wrote: > This is still spitting: > > lib/dlock-list.c: In function ‘cpu2idx_init’: > lib/dlock-list.c:75:16: error: incompatible types when assigning to > type ‘cpumask_var_t’ from type ‘struct cpumask *’ > sibling_mask = topology_sibling_cpumask(cpu); > ^ > lib/dlock-list.c:76:7: warning: the address of ‘sibling_mask’ will > always evaluate as ‘true’ [-Waddress] > if (sibling_mask) { > ^ Thanks for reporting this problem. Dealing with cpumask is always tricky. Could you try the following patch to see if it could fix the problem. Thanks, Longman ---------------------------------------------------- diff --git a/lib/dlock-list.c b/lib/dlock-list.c index f0df7d5..3afd76d 100644 --- a/lib/dlock-list.c +++ b/lib/dlock-list.c @@ -60,7 +60,7 @@ static int __init cpu2idx_init(void) { int idx, cpu; - cpumask_var_t sibling_mask; + struct cpumask *sibling_mask; static struct cpumask mask __initdata; cpumask_clear(&mask); @@ -74,11 +74,9 @@ static int __init cpu2idx_init(void) cpumask_set_cpu(cpu, &mask); sibling_mask = topology_sibling_cpumask(cpu); - if (sibling_mask) { - for_each_cpu(scpu, sibling_mask) { - per_cpu(cpu2idx, scpu) = idx; - cpumask_set_cpu(scpu, &mask); - } + for_each_cpu(scpu, sibling_mask) { + per_cpu(cpu2idx, scpu) = idx; + cpumask_set_cpu(scpu, &mask); } idx++; }