From patchwork Thu Mar 23 11:35:56 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 95900 Delivered-To: patch@linaro.org Received: by 10.140.89.233 with SMTP id v96csp692499qgd; Thu, 23 Mar 2017 04:36:50 -0700 (PDT) X-Received: by 10.99.5.133 with SMTP id 127mr2396372pgf.8.1490269010560; Thu, 23 Mar 2017 04:36:50 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h25si3794598pfk.166.2017.03.23.04.36.50; Thu, 23 Mar 2017 04:36:50 -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=pass header.i=@linaro.org; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933567AbdCWLga (ORCPT + 15 others); Thu, 23 Mar 2017 07:36:30 -0400 Received: from mail-pg0-f47.google.com ([74.125.83.47]:36522 "EHLO mail-pg0-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933392AbdCWLg2 (ORCPT ); Thu, 23 Mar 2017 07:36:28 -0400 Received: by mail-pg0-f47.google.com with SMTP id g2so121694111pge.3 for ; Thu, 23 Mar 2017 04:36:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references; bh=XKRF0py5SmsvtuZJ4DRcI0pxZnzIrsWcnrKWB6NCqe4=; b=ZK/hTWduXMyKHAWK/9MeaeL0ZOX7eyg1Hhg7ITxAeAuU8qh4/DUKA3KXnLA7yjGCM2 BuH/BX4ZckChJlP6BlLX4J7R64ToooaQv/41JcspsWxRsLNxRLNsIgj7caVtyrFbQ6GQ hzYJ2lUdDHHpHt7qgjUYYdPre70K3ccqNv9Ic= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:in-reply-to:references; bh=XKRF0py5SmsvtuZJ4DRcI0pxZnzIrsWcnrKWB6NCqe4=; b=VpKARIbuQeyIfOj4HSF1+Z3DQMhLOxs1L0xjXuYKcBGRBeT3h4Oohi2VTGbX0kUub+ K2rEOwDumKQdhaLJvCJYa/G7dk5B0USloSS9/HGNJg27XyLX2BxlNyfnGNOyV9GbkyVx mMwUlYuoqcSUNlDglhv7gSXnI194m4MearDSpiCxMlAITStzjGWt1ibRHL/GFQcvV0D9 WIqba9p93JtGriDugYoJ6vKVreDtpcKH/jvmmUFMAYZk3Am8xe04BtLMdJd5/gizafzV +Rd+DL5lVmgn+Oxy8IgTK5wjN+mb4NjFeQO4M6ZglyloPNE6xtva39fBVpwaymUSNBxR NoAA== X-Gm-Message-State: AFeK/H1BzeKLXCDhOTEmb4mCUXHPCIdMwjU34EqvgHqh/3DM9pJ/J3ZH6b02/qrgS4HrvGvA X-Received: by 10.84.241.135 with SMTP id b7mr745980pll.188.1490268986913; Thu, 23 Mar 2017 04:36:26 -0700 (PDT) Received: from localhost ([122.171.239.200]) by smtp.gmail.com with ESMTPSA id z63sm9797275pfz.70.2017.03.23.04.36.25 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 23 Mar 2017 04:36:26 -0700 (PDT) From: Viresh Kumar To: Ingo Molnar , Peter Zijlstra Cc: linaro-kernel@lists.linaro.org, linux-kernel@vger.kernel.org, Vincent Guittot , Viresh Kumar Subject: [PATCH 1/4] sched: topology: drop memset() from init_rootdomain() Date: Thu, 23 Mar 2017 17:05:56 +0530 Message-Id: X-Mailer: git-send-email 2.12.0.432.g71c3a4f4ba37 In-Reply-To: References: In-Reply-To: References: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org There are only two callers of init_rootdomain(). One of them passes a global to it and another one sends dynamically allocated root-domain. There is no need to memset the root-domain in the first case as the structure is already reset. Update alloc_rootdomain() to allocate the memory with kzalloc() and remove the memset() call from init_rootdomain(). Signed-off-by: Viresh Kumar --- kernel/sched/topology.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) -- 2.12.0.432.g71c3a4f4ba37 diff --git a/kernel/sched/topology.c b/kernel/sched/topology.c index 1b0b4fb12837..a2497702e628 100644 --- a/kernel/sched/topology.c +++ b/kernel/sched/topology.c @@ -242,8 +242,6 @@ void rq_attach_root(struct rq *rq, struct root_domain *rd) static int init_rootdomain(struct root_domain *rd) { - memset(rd, 0, sizeof(*rd)); - if (!zalloc_cpumask_var(&rd->span, GFP_KERNEL)) goto out; if (!zalloc_cpumask_var(&rd->online, GFP_KERNEL)) @@ -292,7 +290,7 @@ static struct root_domain *alloc_rootdomain(void) { struct root_domain *rd; - rd = kmalloc(sizeof(*rd), GFP_KERNEL); + rd = kzalloc(sizeof(*rd), GFP_KERNEL); if (!rd) return NULL;