From patchwork Thu Apr 13 09:15:48 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 97359 Delivered-To: patch@linaro.org Received: by 10.140.109.52 with SMTP id k49csp630754qgf; Thu, 13 Apr 2017 02:17:06 -0700 (PDT) X-Received: by 10.84.215.23 with SMTP id k23mr2852518pli.58.1492075026469; Thu, 13 Apr 2017 02:17:06 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g17si23353410pgj.222.2017.04.13.02.17.06; Thu, 13 Apr 2017 02:17:06 -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 S1756340AbdDMJQ4 (ORCPT + 13 others); Thu, 13 Apr 2017 05:16:56 -0400 Received: from mail-pf0-f175.google.com ([209.85.192.175]:36019 "EHLO mail-pf0-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756298AbdDMJQx (ORCPT ); Thu, 13 Apr 2017 05:16:53 -0400 Received: by mail-pf0-f175.google.com with SMTP id o126so26130035pfb.3 for ; Thu, 13 Apr 2017 02:16:53 -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=QO4lqifOSIVOd0FvTajVLHU+95g+6Mg0bco5FNSbkfGZ3IgAqZldD/ZMa2TuHu/FQR ecTZB3OVDH54eOkxwRdWXshfwXM4vBOFkl3eYHdsDxszsB3ZuBzxpQ/O69duvSCT/HxV ewewS2ZRMyjWkpXsx1cXxMwxNCkbmOnQXnl6g= 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=jdN+H5B9u3+eN1H0Ko6Zg5tTvdEYcBPgQjD9882BlOn3AyD5lWLDfvoBQ193zQUglj ulIp0GFuBYEYEtpUVTkeu/Sep8cCY5yU8Fdg2lTfAaemrlkDOINOzcZNZwQ4ovK73lam KBKqTAacxrbWWdSfjt0pxg1fpdL3v7aXmxuolupT0lu8ksdEW4+EK9DTQQXwOra/FeY8 qYl2Am2sfc0f3JLojeG9qAwfzHcWzUfcw45iNQkHfQY00ILyvfu4gq2cY4pzDtexbgO2 6vZXrKuozE0a1ycMvBE7TZueCbo7fluRkni/w0RtUNSjXXUQA7mD0WJMqK96n67Vti5r GpHQ== X-Gm-Message-State: AN3rC/4aKmDV1WDZeopDhz+k8pwCAwzBC0oJmjUmAXexEofuigGBRp9B dMifdz17Y7DozTeHVUFddg== X-Received: by 10.84.224.73 with SMTP id a9mr2957660plt.38.1492075012616; Thu, 13 Apr 2017 02:16:52 -0700 (PDT) Received: from localhost ([122.172.121.5]) by smtp.gmail.com with ESMTPSA id 201sm41138728pfc.126.2017.04.13.02.16.51 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 13 Apr 2017 02:16:52 -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 V2 1/3] sched: topology: drop memset() from init_rootdomain() Date: Thu, 13 Apr 2017 14:45:48 +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; From patchwork Thu Apr 13 09:15:49 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 97361 Delivered-To: patch@linaro.org Received: by 10.140.109.52 with SMTP id k49csp630800qgf; Thu, 13 Apr 2017 02:17:15 -0700 (PDT) X-Received: by 10.98.63.85 with SMTP id m82mr2276677pfa.143.1492075035591; Thu, 13 Apr 2017 02:17:15 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c10si23416062pfd.304.2017.04.13.02.17.15; Thu, 13 Apr 2017 02:17:15 -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 S1756413AbdDMJRG (ORCPT + 13 others); Thu, 13 Apr 2017 05:17:06 -0400 Received: from mail-pg0-f41.google.com ([74.125.83.41]:34931 "EHLO mail-pg0-f41.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756357AbdDMJRB (ORCPT ); Thu, 13 Apr 2017 05:17:01 -0400 Received: by mail-pg0-f41.google.com with SMTP id 72so19425633pge.2 for ; Thu, 13 Apr 2017 02:17:01 -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=8yqszUftzrjwuq8eqAiVMdudHu/BOHTm2s/9Bz0QRiw=; b=iu0VxAZhCkpL0sGNvWObGhnw8NlNtGRXeSDz/sIlOuhVFlEOHWjBfkGhaUN8+K7GjR 1DVGXLLnBdxwFxr+czXweyA7KhyDBSsAdrA7AoOkYb3WoT5A9XVMeS68R0dUMlRz04iE KY9Mh1gzNeLpKHkyPLAhQ6RrKKGjk+zq9Ec6E= 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=8yqszUftzrjwuq8eqAiVMdudHu/BOHTm2s/9Bz0QRiw=; b=XSaCjweZEGAKIYc6M3TH3GDPkOzj3c2POJ/mf4s8rpEVybt+kuEHAPoxcih8p8rSdT 9gWavu/bZfLV7PIhwQJP3SefZ14v3AWNoi+D9pgcP3JvwmCs8yEmrBuLuMdcQ7jbN+OZ TaN4ozLqim1mAhdg0EALp4y58bVvkNKLQ7AoWUuhLsPSEaXp4ybnqYFBiPxS7bg1UuBo D70BBy4XeFq9H2uwTeKrxfHy96I7JjNpZmMcrXNxHF4hI3roG5m11qetDlwpc7ynpAML skjULy3VbIQPvfxMdnIybb1CzH/bOP9q0YuTZpsljUrYeg6KZMt82D/Jr2RTX2D443ig lkFA== X-Gm-Message-State: AN3rC/6oZxI+WglkOVVNs4hAnoOB2kImYuayDXCJsL0UfcI4l+2uO/Pb W0r5zfLBZMlBCGwW X-Received: by 10.84.224.198 with SMTP id k6mr2870439pln.15.1492075015765; Thu, 13 Apr 2017 02:16:55 -0700 (PDT) Received: from localhost ([122.172.121.5]) by smtp.gmail.com with ESMTPSA id p68sm41197137pga.6.2017.04.13.02.16.54 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 13 Apr 2017 02:16:55 -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 V2 2/3] sched: cpudeadline: don't re-initialize struct cpudl Date: Thu, 13 Apr 2017 14:45:49 +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 The struct cpudl passed to cpudl_init() is already initialized to zero. Don't do that again. Signed-off-by: Viresh Kumar --- kernel/sched/cpudeadline.c | 1 - 1 file changed, 1 deletion(-) -- 2.12.0.432.g71c3a4f4ba37 diff --git a/kernel/sched/cpudeadline.c b/kernel/sched/cpudeadline.c index fba235c7d026..bdf448b6556f 100644 --- a/kernel/sched/cpudeadline.c +++ b/kernel/sched/cpudeadline.c @@ -246,7 +246,6 @@ int cpudl_init(struct cpudl *cp) { int i; - memset(cp, 0, sizeof(*cp)); raw_spin_lock_init(&cp->lock); cp->size = 0; From patchwork Thu Apr 13 09:15:50 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 97360 Delivered-To: patch@linaro.org Received: by 10.140.109.52 with SMTP id k49csp630757qgf; Thu, 13 Apr 2017 02:17:07 -0700 (PDT) X-Received: by 10.84.230.129 with SMTP id e1mr2920382plk.66.1492075027088; Thu, 13 Apr 2017 02:17:07 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g17si23353410pgj.222.2017.04.13.02.17.06; Thu, 13 Apr 2017 02:17:07 -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 S1756394AbdDMJRE (ORCPT + 13 others); Thu, 13 Apr 2017 05:17:04 -0400 Received: from mail-pg0-f52.google.com ([74.125.83.52]:33373 "EHLO mail-pg0-f52.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756345AbdDMJQ7 (ORCPT ); Thu, 13 Apr 2017 05:16:59 -0400 Received: by mail-pg0-f52.google.com with SMTP id x125so27902112pgb.0 for ; Thu, 13 Apr 2017 02:16:59 -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=QQ9vviAMjqRqZGppcOjP73i+MTrvTMUDrniSAnxXmQU=; b=RCU8POjrxzReEiWHIt4GxNk//RlaWk03mlX9eQWy7Wo34MIiwqsp5sA8jUojby19wZ rQanceAuG6rBPco9o2y34Vx9o5jxOaDVE9gJzAoi0A1O3NPANVjj0uxIUxLt9Xjj04eo UaQSzmSw3JVTTjk/yQrVUNAL74ZW0eGmySNBc= 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=QQ9vviAMjqRqZGppcOjP73i+MTrvTMUDrniSAnxXmQU=; b=PZGa0SVAvAUE3OvTu+nRrAc/yszuY/vrFmoGG1aysML7XQKGXdyohoooM10JJkQqUs X0mRfQzM0vclkV8UD+hWaMEI0gZlYvmGbx9XZDgCogT14ymUtAb8V1GsRBJYxkhdn3D0 1/oYWCXmC5Qy1WRL5dPH5RW7Rn6JYXksHP/GpoDQlf0kkSXNzBNIbtRWngEo5ZpzYtPO TvEpsdA7f2HZBIjYNaa/YeZWNTwEvRljkv8aPK7W17wh87xl/+lMqcl3zQl60EnItITT 5IKrVcGibQsTiep5BKj0mk8BYt9NA6tgEfvmV4bo9aHWJNpLMK2cSDSJa1ugKyFZwt48 Y90g== X-Gm-Message-State: AN3rC/67puB2W0N5FL+pxLgGQuMpQZxLDFIsGrXDVPFdGaMYoey+zLm0 HGzxn1pqyHtRplvW X-Received: by 10.99.115.6 with SMTP id o6mr2250326pgc.216.1492075018944; Thu, 13 Apr 2017 02:16:58 -0700 (PDT) Received: from localhost ([122.172.121.5]) by smtp.gmail.com with ESMTPSA id b5sm28179651pfb.21.2017.04.13.02.16.57 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 13 Apr 2017 02:16:58 -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 V2 3/3] sched: cpupri: don't re-initialize struct cpupri Date: Thu, 13 Apr 2017 14:45:50 +0530 Message-Id: <8a71d48c5a077500b6ddc1a41484c0ac8d3aad94.1492065513.git.viresh.kumar@linaro.org> 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 The struct cpupri passed to cpupri_init() is already initialized to zero. Don't do that again. Signed-off-by: Viresh Kumar --- kernel/sched/cpupri.c | 2 -- 1 file changed, 2 deletions(-) -- 2.12.0.432.g71c3a4f4ba37 diff --git a/kernel/sched/cpupri.c b/kernel/sched/cpupri.c index 981fcd7dc394..2511aba36b89 100644 --- a/kernel/sched/cpupri.c +++ b/kernel/sched/cpupri.c @@ -209,8 +209,6 @@ int cpupri_init(struct cpupri *cp) { int i; - memset(cp, 0, sizeof(*cp)); - for (i = 0; i < CPUPRI_NR_PRIORITIES; i++) { struct cpupri_vec *vec = &cp->pri_to_cpu[i];