From patchwork Mon Aug 14 06:34:27 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peng Zhang X-Patchwork-Id: 13352428 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3931FC001B0 for ; Mon, 14 Aug 2023 06:34:45 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 883C58D0002; Mon, 14 Aug 2023 02:34:44 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 834B68D0001; Mon, 14 Aug 2023 02:34:44 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 724E68D0002; Mon, 14 Aug 2023 02:34:44 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id 5FFC68D0001 for ; Mon, 14 Aug 2023 02:34:44 -0400 (EDT) Received: from smtpin12.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id 3D1E740AB1 for ; Mon, 14 Aug 2023 06:34:44 +0000 (UTC) X-FDA: 81121746888.12.BDC78E3 Received: from szxga08-in.huawei.com (szxga08-in.huawei.com [45.249.212.255]) by imf29.hostedemail.com (Postfix) with ESMTP id B09F512000E for ; Mon, 14 Aug 2023 06:34:41 +0000 (UTC) Authentication-Results: imf29.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf29.hostedemail.com: domain of zhangpeng362@huawei.com designates 45.249.212.255 as permitted sender) smtp.mailfrom=zhangpeng362@huawei.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1691994882; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=pmFcbTknQ3HLiO/EH7lo0/s0iOkl8xDKF/Y/+3CYvrY=; b=fAIKgZ6A1LbyxhlKT4r8cVoz+uU83tQq4WPc9+1DF/SGkdTtEI1sRP670oT9FIAmYWQp+1 +OzUZuIjUG1HZKCt4fwtqpO0HzPEtTiQiJ/W1ydNb5KAP97ZTFynbfB25smhOEX1UNMIpY oV+9HgdfxGjot/AmZoP/pDm5btPVUPE= ARC-Authentication-Results: i=1; imf29.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf29.hostedemail.com: domain of zhangpeng362@huawei.com designates 45.249.212.255 as permitted sender) smtp.mailfrom=zhangpeng362@huawei.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1691994882; a=rsa-sha256; cv=none; b=NYq8CstSRM/4VD8aGkH6VC6JhB0ZJicXBiTAE0D27AF8pXqmH0QQ5s1EzADy61C+R+l2z+ qpv/e106MDB01lE6tgzx/wKdlGsQwQkwMXZJsND4DAB9vXBa7E8rl9I8PpuWX7VlhQZHry UFgP7GIwjqQ+I2LjhAM4rnRe8jWaWAI= Received: from kwepemm600020.china.huawei.com (unknown [172.30.72.56]) by szxga08-in.huawei.com (SkyGuard) with ESMTP id 4RPPjV5ddvz1GDG0; Mon, 14 Aug 2023 14:33:18 +0800 (CST) Received: from localhost.localdomain (10.175.112.125) by kwepemm600020.china.huawei.com (7.193.23.147) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.31; Mon, 14 Aug 2023 14:34:35 +0800 From: Peng Zhang To: CC: , , , , , ZhangPeng Subject: [PATCH 1/2] mm: oom: remove unnecessary goto in oom_evaluate_task() Date: Mon, 14 Aug 2023 14:34:27 +0800 Message-ID: <20230814063428.4111206-2-zhangpeng362@huawei.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230814063428.4111206-1-zhangpeng362@huawei.com> References: <20230814063428.4111206-1-zhangpeng362@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.175.112.125] X-ClientProxiedBy: dggems704-chm.china.huawei.com (10.3.19.181) To kwepemm600020.china.huawei.com (7.193.23.147) X-CFilter-Loop: Reflected X-Rspamd-Queue-Id: B09F512000E X-Rspam-User: X-Rspamd-Server: rspam02 X-Stat-Signature: dqwcbmitpkrcuxa1jikcwz8esi1oxabh X-HE-Tag: 1691994881-794902 X-HE-Meta: U2FsdGVkX1+R/U/nmMMAiO3VI0np3Rhw8qfC2fCR+4xruR5sDRNbEuAvx706WIG1IQmhVWvnKLHGh1r85w/ZCAWvoodb9DgDo1cko2nDnCvqsX8moFEebJ8e//qXL7D3h7jIpdlGKzM4B9zJu0wFLsjSabQpChp8WdM0OIPAgulewtN2tUYmNG8GFmfOue8IDvirJiMQZQQ7YHEPlQ27tdWF+SLShAyb00JLWQvnXChQudo7OYgri4PzTua5J7ChpPYkVrPW5S/wriZvQGA7mUTW+t6+6Lcz/CMqIsTziWUHdt9Dd7+3FfszVhtEc7LewPkIIO1HQVALWyZfmMeYkH+nRXc0b7uRXzK0qTlqP+5QlLZys5uYjmrpWfNJnvaxU38Ql2HMXsJE8l8y+iBLeq68O6ZY/m5onYunHMx+J8CDS5lecIhsusqPxarvtC//cVB+PfV94XyWzDUjF5xPlZ1S6xrX42Ot7IdtwhL8AkrhgBCQPsznsN0dAOjPHWSTXXSHFXuw6g4mxP4iuBHzBO2RUrM6G2l5v/lHblG8uXalnjSIOPYv7F6HqqNNPOQHIYkt2c151pCHukPUXv5T4FkSvq3NL8mMTlThnhVMWYdsm2CW4CTtuQW9BGU1eYDLHaIM+MaxDiMFpKN5wc05oFYSplR+gff1Tk/k29bNA1RpQfB6WAw4Krfw3U2QqZq+6qpFnSDxMcuAnsy9XzwaEYxVYoAWnhJN/vRTKbdlkIQtWvnw0EQYqGYiHB7Wn/GyGCbmO0SSV3Im0AT3X7aLXV4iB06m5uKGQL8T7VYRKY/PNKYEmdgggNj5BQzBQLFO3Il8uyHeqw82gwaCZDKMj3GTfoRT+0nYrbGJ6+G2HiMbQ0Jfy3iJlTEmC+e2t7C7YjoJ31zWhAYQEl/tn6qJ3iTa7f868PgdnIKd6UmILFIanV5ZGBlYgdKM4OxwZFGQ9ShbnBh43e/WF+Hpwc9 uhxefnzd YnPuNzg25wZ5HeehLRn9SJskrKOR2amgaXy2upViv4WHk6250kvgdtaAarigUJb8QMpP+XJ9t66EdMlk+qdB3CMmUUCggsZfnq8sMk44EDcaKyqC/jcUj2ioU04x8zcob1q6EnDoJBz63KPF7oeRyrSsw4qi8tME0xOCuoCBKxgdC841uF2Gru6En+ia9mvgtDogo X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: From: ZhangPeng Remove redundant goto statement in oom_evaluate_task() to simplify the code a bit. No functional modification involved. Signed-off-by: ZhangPeng --- mm/oom_kill.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/mm/oom_kill.c b/mm/oom_kill.c index 44bde56ecd02..10f7826c4035 100644 --- a/mm/oom_kill.c +++ b/mm/oom_kill.c @@ -335,14 +335,12 @@ static int oom_evaluate_task(struct task_struct *task, void *arg) */ if (oom_task_origin(task)) { points = LONG_MAX; - goto select; + } else { + points = oom_badness(task, oc->totalpages); + if (points == LONG_MIN || points < oc->chosen_points) + goto next; } - points = oom_badness(task, oc->totalpages); - if (points == LONG_MIN || points < oc->chosen_points) - goto next; - -select: if (oc->chosen) put_task_struct(oc->chosen); get_task_struct(task);