From patchwork Sun Oct 4 12:58:27 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lukas Bulwahn X-Patchwork-Id: 11815653 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 08D19112E for ; Sun, 4 Oct 2020 12:58:48 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id A287F206C1 for ; Sun, 4 Oct 2020 12:58:47 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="CnISbJko" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A287F206C1 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 90C9B6B005D; Sun, 4 Oct 2020 08:58:46 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 8BDEE6B0062; Sun, 4 Oct 2020 08:58:46 -0400 (EDT) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 7D25D6B0068; Sun, 4 Oct 2020 08:58:46 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0117.hostedemail.com [216.40.44.117]) by kanga.kvack.org (Postfix) with ESMTP id 4F20A6B005D for ; Sun, 4 Oct 2020 08:58:46 -0400 (EDT) Received: from smtpin19.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id E15B4180AD801 for ; Sun, 4 Oct 2020 12:58:45 +0000 (UTC) X-FDA: 77334247410.19.scent86_0c14d11271b5 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin19.hostedemail.com (Postfix) with ESMTP id C19C01ACEBC for ; Sun, 4 Oct 2020 12:58:45 +0000 (UTC) X-Spam-Summary: 1,0,0,cdd2013e20c7bfe3,d41d8cd98f00b204,lukas.bulwahn@gmail.com,,RULES_HIT:41:355:379:541:800:960:968:973:988:989:1260:1345:1437:1534:1541:1711:1730:1747:1777:1792:2194:2198:2199:2200:2393:2559:2562:2693:2731:2893:2915:3138:3139:3140:3141:3142:3353:3865:3866:3867:3868:3870:3871:3872:3874:4321:5007:6261:6653:7514:7903:7974:8957:9413:10004:11026:11658:11914:12043:12296:12297:12438:12517:12519:12555:12895:12986:13069:13161:13229:13311:13357:14096:14181:14384:14394:14687:14721:21080:21325:21444:21451:21611:21627:21666:21990:30012:30054:30069:30070,0,RBL:209.85.218.68:@gmail.com:.lbl8.mailshell.net-66.100.201.100 62.50.0.100;04yrbsxh6tjm1tn6tqizojmo1mopzyczcuq1sfwiityxqio4e4di9ko71ychmuf.xj7pwqxp4t8uy5e4eufr86n1m56dnnyknukjgp6pz89a7o9ugzeydcdknwp888g.4-lbl8.mailshell.net-223.238.255.100,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fp,MSBL:0,DNSBL:neutral,Custom_rules:0:0:0,LFtime:24,LUA_SUMMARY:none X-HE-Tag: scent86_0c14d11271b5 X-Filterd-Recvd-Size: 4845 Received: from mail-ej1-f68.google.com (mail-ej1-f68.google.com [209.85.218.68]) by imf44.hostedemail.com (Postfix) with ESMTP for ; Sun, 4 Oct 2020 12:58:45 +0000 (UTC) Received: by mail-ej1-f68.google.com with SMTP id ly6so6767483ejb.8 for ; Sun, 04 Oct 2020 05:58:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=PUKRKz2tpvOlgzU6T8LFm9id6xQAJB/MM9M3WUFXc+A=; b=CnISbJkoNvxTd5jIBOUlg9+BwkmuM63uKyfAmzazkQPXDTqNIA93w1bVoM2LjX9rcP oj8EpHnwqbDa3gONf7UUd83FE/mcIGUXIEphNUeP5ZdvxKQC/Mcqalfel8rl4eeoXDwV zzWfgSGtpUbv/hnt60yCzn7DeKx7iEkuhYh1721A9nrnW08qOvQB52N857lNypvzsK77 8kV5CMdB5GI/65/AwAMlzexf8hxVxeGRw+U8uM/hFEUFHK7L0Gy2xQFXRv84seuGEv3/ qOrTHwvSxKMwSLLoKZO1agRRV2g2Zqag0ei6n6PbFQ6+QmJvvni0+o59qD1f0MfoTJvi Upcw== 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; bh=PUKRKz2tpvOlgzU6T8LFm9id6xQAJB/MM9M3WUFXc+A=; b=es8y6rA1k7kirjYB81RLISli8OLj/Zp5bBMYokTeYRROYWD7loV5i46nYxmLuWSZcs 9MW96tTlfAuG/N3TT+Hhu88xT2G0OT9M2mFIFjtzTNTPPAGvOHxBzxNmiGnQOROvVNOk 9sJVi1/lsPN89jX2xrtPSagMDMz5Ai3o9dQW+wPkMYoZGBExOg02xkwaYockIEx7p46p qYaiM5237PF27x8G7qVYoxyuQiQmECODPSbpk4SRoVaS9EjWH0+VwnNnmZZRXmgj1q5o U5P/iRX22uBNXNRKvsu9KLmFhyZBzMmhTvwaQtgBGlNoPQc5b/igbsDnfoncfVN4TMVA ebAA== X-Gm-Message-State: AOAM530EiJzahahSIFkPoxU1xrt7yUa151wt0qG89ORkw0m8R4f8iYS1 gPOYfeOz8EPuPy8ReJW3jW4= X-Google-Smtp-Source: ABdhPJxNxrY0nIitVq0DwnUHIuVobxEYUgHoqu1kxAvSNcHLXGtq22k3XIW26iFfBBt4+NxCMI6YUw== X-Received: by 2002:a17:906:52d1:: with SMTP id w17mr10339057ejn.164.1601816324134; Sun, 04 Oct 2020 05:58:44 -0700 (PDT) Received: from felia.fritz.box ([2001:16b8:2d26:f700:59a3:d1dd:4e61:fceb]) by smtp.gmail.com with ESMTPSA id a10sm2751747edu.78.2020.10.04.05.58.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 04 Oct 2020 05:58:43 -0700 (PDT) From: Lukas Bulwahn To: Mel Gorman , Andrew Morton , linux-mm@kvack.org Cc: Vlastimil Babka , Michal Hocko , Nathan Chancellor , Nick Desaulniers , linux-kernel@vger.kernel.org, clang-built-linux@googlegroups.com, kernel-janitors@vger.kernel.org, linux-safety@lists.elisa.tech, Lukas Bulwahn Subject: [PATCH] mm/vmscan: drop unneeded assignment in kswapd() Date: Sun, 4 Oct 2020 14:58:27 +0200 Message-Id: <20201004125827.17679-1-lukas.bulwahn@gmail.com> X-Mailer: git-send-email 2.17.1 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: The refactoring to kswapd() in commit e716f2eb24de ("mm, vmscan: prevent kswapd sleeping prematurely due to mismatched classzone_idx") turned an assignment to reclaim_order into a dead store, as in all further paths, reclaim_order will be assigned again before it is used. make clang-analyzer on x86_64 tinyconfig caught my attention with: mm/vmscan.c: warning: Although the value stored to 'reclaim_order' is used in the enclosing expression, the value is never actually read from 'reclaim_order' [clang-analyzer-deadcode.DeadStores] Compilers will detect this unneeded assignment and optimize this anyway. So, the resulting binary is identical before and after this change. Simplify the code and remove unneeded assignment to make clang-analyzer happy. No functional change. No change in binary code. Signed-off-by: Lukas Bulwahn Acked-by: Mel Gorman --- applies cleanly on current master and next-20201002 Mel, please ack. Andrew, please pick this minor non-urgent clean-up patch. I quickly confirmed that the binary did not change with this change to the source code; The hash of mm/vmscan.o remained the same before and after the change. So, in my setup: md5sum mm/vmscan.o 7da4675477f186263e36b726cc2b859d mm/vmscan.o linux-safety, please verify and validate this change. mm/vmscan.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/vmscan.c b/mm/vmscan.c index 466fc3144fff..130ee40c1255 100644 --- a/mm/vmscan.c +++ b/mm/vmscan.c @@ -3896,7 +3896,7 @@ static int kswapd(void *p) highest_zoneidx); /* Read the new order and highest_zoneidx */ - alloc_order = reclaim_order = READ_ONCE(pgdat->kswapd_order); + alloc_order = READ_ONCE(pgdat->kswapd_order); highest_zoneidx = kswapd_highest_zoneidx(pgdat, highest_zoneidx); WRITE_ONCE(pgdat->kswapd_order, 0);