From patchwork Sun May 7 02:33:52 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Li kunyu X-Patchwork-Id: 90404 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp285418vqo; Fri, 5 May 2023 03:13:46 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5AC9wTqVRNItkbvOM79kLLFdFIutZBTkrLEprrBnxozVh0ak8WXUqsYfSO+ad/M18HxBFE X-Received: by 2002:a05:6a20:3d17:b0:f8:ea21:7c4b with SMTP id y23-20020a056a203d1700b000f8ea217c4bmr1246829pzi.30.1683281626192; Fri, 05 May 2023 03:13:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683281626; cv=none; d=google.com; s=arc-20160816; b=DJWqe8Uq7E8UQihFn2pISFQEroQP4gJ3ElKmadPIrGXDE0Q7hMCivcfP2xfo0VeAvl PjEJwnwhREp+9GgzZWrUWGOlqvn2Wbw3I0Vb3x8BYnRAZ1v0vh5WO7K7Uyt+iidkVO0t XYd/pCOGm6k5dl8EG2wwPu5Go44HMqwFpfIZEunHwfg9baB9KPEKZhjsiuZOu4rulrxM WRLI8UNkXA4ucxf9EBNqpdo96qLz4YlmZSnNm9SVLAxMMGPA/XBpPLS3Nh/HinOmNzux fkm/lEkLro+47Vk55ItGu0TWBIJaKyhLO4bo1oMxMT6rY/jNFj4ocBkigWdpp77eLU15 kRpQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:subject:cc:to:from; bh=cyAPt7p+ZivcBlwXbpT8/ZNrQEg6LzDr3IhUDcZhuPk=; b=O/tAu7CYx0BYHHhfKq2U5NttuvJtV8QTe4iVxgYr0lqat9X/AVjXBAceeqCOcjfA6E rATzmAV8DDJ6Ph8Ll2547iyj/WXN0wrdo1JbUAbgMfZwiMIO72ADycav8nYytAlj8rmG GMq5KOL/RqCIqXW0c8L4Igz9Ht9YSIHZZZfRl2YZff4hAkItqQkE278J3RJId1F2zNJg 83mIWsabYWg9AY7dgSZQ0hvO0D7q0JuJXb71VVRc+6o8y/yMvUr4rgKxre9zLSapBCOH axPU5Zym3XsiSTun/9MDIXJAegWmcYKbWh9mEjsNo0AlguKUg2SP3U98AmSaS2uqvjCM 9SHA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id v184-20020a6389c1000000b0051394ccd19csi1716074pgd.55.2023.05.05.03.13.33; Fri, 05 May 2023 03:13:46 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231821AbjEEKCs (ORCPT + 99 others); Fri, 5 May 2023 06:02:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59302 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231703AbjEEKCj (ORCPT ); Fri, 5 May 2023 06:02:39 -0400 Received: from mail.nfschina.com (unknown [42.101.60.195]) by lindbergh.monkeyblade.net (Postfix) with SMTP id D2DF91BD4 for ; Fri, 5 May 2023 03:02:37 -0700 (PDT) Received: from localhost.localdomain (unknown [219.141.250.2]) by mail.nfschina.com (Maildata Gateway V2.8.8) with ESMTPA id 6EED718013B42C; Fri, 5 May 2023 18:02:32 +0800 (CST) X-MD-Sfrom: kunyu@nfschina.com X-MD-SrcIP: 219.141.250.2 From: Li kunyu To: mingo@redhat.com, peterz@infradead.org, juri.lelli@redhat.com, vincent.guittot@linaro.org, dietmar.eggemann@arm.com, rostedt@goodmis.org, bsegall@google.com, mgorman@suse.de, bristot@redhat.com, vschneid@redhat.com Cc: linux-kernel@vger.kernel.org, Li kunyu Subject: [PATCH] sched: core: Simplify init_sched_mm_cid() Date: Sun, 7 May 2023 10:33:52 +0800 Message-Id: <20230507023352.2784-1-kunyu@nfschina.com> X-Mailer: git-send-email 2.18.2 X-Spam-Status: No, score=0.9 required=5.0 tests=BAYES_00,DATE_IN_FUTURE_24_48, RDNS_NONE,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1765048714403214241?= X-GMAIL-MSGID: =?utf-8?q?1765048714403214241?= int mm_users variable definition move to variable usage location. Signed-off-by: Li kunyu --- kernel/sched/core.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/kernel/sched/core.c b/kernel/sched/core.c index f341e2100304..a66960da3f5c 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c @@ -11910,10 +11910,9 @@ static void task_mm_cid_work(struct callback_head *work) void init_sched_mm_cid(struct task_struct *t) { struct mm_struct *mm = t->mm; - int mm_users = 0; if (mm) { - mm_users = atomic_read(&mm->mm_users); + int mm_users = atomic_read(&mm->mm_users); if (mm_users == 1) mm->mm_cid_next_scan = jiffies + msecs_to_jiffies(MM_CID_SCAN_DELAY); }