From patchwork Tue Nov 3 13:03:33 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yang Shi X-Patchwork-Id: 11885099 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 4BE36697 for ; Thu, 5 Nov 2020 20:53:54 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id EFB9F20724 for ; Thu, 5 Nov 2020 20:53:53 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="iTdqtA5C" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org EFB9F20724 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 9D6C46B019A; Thu, 5 Nov 2020 15:53:52 -0500 (EST) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 98BD06B019C; Thu, 5 Nov 2020 15:53:52 -0500 (EST) 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 7E1266B019B; Thu, 5 Nov 2020 15:53:52 -0500 (EST) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0075.hostedemail.com [216.40.44.75]) by kanga.kvack.org (Postfix) with ESMTP id 41D996B0197 for ; Thu, 5 Nov 2020 15:53:52 -0500 (EST) Received: from smtpin14.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id C274D181AEF07 for ; Thu, 5 Nov 2020 20:53:51 +0000 (UTC) X-FDA: 77451566262.14.blade48_5e0d3ce272cc Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin14.hostedemail.com (Postfix) with ESMTP id A1B9718229818 for ; Thu, 5 Nov 2020 20:53:51 +0000 (UTC) X-Spam-Summary: 1,0,0,4b1e580d4512a80c,d41d8cd98f00b204,shy828301@gmail.com,,RULES_HIT:41:355:379:541:800:960:973:988:989:1202:1260:1311:1314:1345:1359:1437:1515:1535:1542:1711:1730:1747:1777:1792:2393:2553:2559:2562:3138:3139:3140:3141:3142:3353:3865:3866:3867:3868:3871:3872:3874:4250:4321:4605:5007:6261:6653:7514:9413:9592:10004:11026:11473:11658:11914:12043:12048:12114:12296:12297:12438:12517:12519:12555:12895:12986:13161:13229:13894:14096:14181:14394:14687:14721:21060:21080:21444:21627:21666:21740:21990:30054:30070:30090,0,RBL:209.85.210.194:@gmail.com:.lbl8.mailshell.net-66.100.201.100 62.50.0.100;04yf9ufgb3u1awokataxmisz3bb1xocwxzokux4m8pr6n5q5wkwyfanzyde16gc.s7qf4wx6txhss5i5bz15hn1ngn3arsi3tkhc93ktz71fzkjeotcit9wb5m3r83f.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:70,LUA_SUMMARY:none X-HE-Tag: blade48_5e0d3ce272cc X-Filterd-Recvd-Size: 5556 Received: from mail-pf1-f194.google.com (mail-pf1-f194.google.com [209.85.210.194]) by imf14.hostedemail.com (Postfix) with ESMTP for ; Thu, 5 Nov 2020 20:53:51 +0000 (UTC) Received: by mail-pf1-f194.google.com with SMTP id y7so1226696pfq.11 for ; Thu, 05 Nov 2020 12:53:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=6Leqw7u0Dj1Vz2BsTHyCIMeIKX4OIeHsLYnWeVSaw6Y=; b=iTdqtA5C73Vrz3wnXMfi2ehPUNtrgAzfjSC9sbuyb4PjCLL0bzTeRuU2Ma1bqfw5+M LTLPzs3uOWNX7IhP1zl2a+iyG7Ey3kmIaxok8+vFnhm+Krd7p0wP5F9jQ7e+OVwyX4Bi I1W1/E/4pNkN34HwwDGKqFo/gEPafUvsxpwT76QX/vz0ooKmKgphWAAxGJce0w9X1Zp/ J0oTYiUh2XhPeosOm4yZNQPCm6b4Okc7xfgCrhWLHQS66AjHGI17+LpRJwGyISImBU0I DACaGmustp++exPUVtB4TgIOpY1i2QtywH5XI5kmRIcLv3PvmQV22AE6nHTy3u4KnXVQ GeRg== 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:mime-version:content-transfer-encoding; bh=6Leqw7u0Dj1Vz2BsTHyCIMeIKX4OIeHsLYnWeVSaw6Y=; b=PRZ1e0fXh1zNHOzmOmdQWwLm7UyJ4pmo6Fldf1UHmHGK/wQ8OqquCyW+znZKZ0gFqn rcgV71nWWks4DKFwwt85g0DN5y/rvPuh+nzaCf5zgo27tE9HykovhH55+bGy2TwLrHRZ dfln+i/W4uiOaDvrj8wGwMKWRi5+6Mqq1e8XWmul5gqzvPhXfMuzyx8Tfheq9YHSEfuX RwhGhekE7/niWQbXHQvQ3v7F13XYjzW8prR6GjhOu0dvpcETh12qCzTr+0FlFwy50NYW 9NW06CJ4iLCpB9hzGWb2KAn+/0rFMHJom7v3uaYXIroarIbi1F5mLlSjl1KpOabaqKW0 IGwQ== X-Gm-Message-State: AOAM530WZsv8DNGI22j5rvMmi8C07xqUJ8ubYlP8lfSlfVrHxYFIUIN7 jUiajittaMm0y9GP0l7fIks= X-Google-Smtp-Source: ABdhPJxUZsNTq7EX7hHHMb5GM4tGtzAlPxZWwcwNcY7v3Qei0TEfEn0WLfqFpXFSp6pHxKAj/gpXtg== X-Received: by 2002:a62:a10a:0:b029:154:fd62:ba90 with SMTP id b10-20020a62a10a0000b0290154fd62ba90mr4303657pff.62.1604609630470; Thu, 05 Nov 2020 12:53:50 -0800 (PST) Received: from localhost.localdomain (c-107-3-138-210.hsd1.ca.comcast.net. [107.3.138.210]) by smtp.gmail.com with ESMTPSA id u22sm3265528pgf.24.2020.11.05.12.53.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Nov 2020 12:53:49 -0800 (PST) From: Yang Shi To: mhocko@suse.com, ziy@nvidia.com, songliubraving@fb.com, mgorman@suse.de, jack@suse.cz, akpm@linux-foundation.org Cc: shy828301@gmail.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: [PATCH 4/5] mm: migrate: clean up migrate_prep{_local} Date: Tue, 3 Nov 2020 05:03:33 -0800 Message-Id: <20201103130334.13468-5-shy828301@gmail.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20201103130334.13468-1-shy828301@gmail.com> References: <20201103130334.13468-1-shy828301@gmail.com> MIME-Version: 1.0 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 migrate_prep{_local} never fails, so it is pointless to have return value and check the return value. Signed-off-by: Yang Shi --- include/linux/migrate.h | 4 ++-- mm/mempolicy.c | 8 ++------ mm/migrate.c | 8 ++------ 3 files changed, 6 insertions(+), 14 deletions(-) diff --git a/include/linux/migrate.h b/include/linux/migrate.h index 0f8d1583fa8e..4594838a0f7c 100644 --- a/include/linux/migrate.h +++ b/include/linux/migrate.h @@ -45,8 +45,8 @@ extern struct page *alloc_migration_target(struct page *page, unsigned long priv extern int isolate_movable_page(struct page *page, isolate_mode_t mode); extern void putback_movable_page(struct page *page); -extern int migrate_prep(void); -extern int migrate_prep_local(void); +extern void migrate_prep(void); +extern void migrate_prep_local(void); extern void migrate_page_states(struct page *newpage, struct page *page); extern void migrate_page_copy(struct page *newpage, struct page *page); extern int migrate_huge_page_move_mapping(struct address_space *mapping, diff --git a/mm/mempolicy.c b/mm/mempolicy.c index 3fde772ef5ef..780861312008 100644 --- a/mm/mempolicy.c +++ b/mm/mempolicy.c @@ -1114,9 +1114,7 @@ int do_migrate_pages(struct mm_struct *mm, const nodemask_t *from, int err; nodemask_t tmp; - err = migrate_prep(); - if (err) - return err; + migrate_prep(); mmap_read_lock(mm); @@ -1315,9 +1313,7 @@ static long do_mbind(unsigned long start, unsigned long len, if (flags & (MPOL_MF_MOVE | MPOL_MF_MOVE_ALL)) { - err = migrate_prep(); - if (err) - goto mpol_out; + migrate_prep(); } { NODEMASK_SCRATCH(scratch); diff --git a/mm/migrate.c b/mm/migrate.c index 9a32bb128f31..8f6a61c9274b 100644 --- a/mm/migrate.c +++ b/mm/migrate.c @@ -62,7 +62,7 @@ * to be migrated using isolate_lru_page(). If scheduling work on other CPUs is * undesirable, use migrate_prep_local() */ -int migrate_prep(void) +void migrate_prep(void) { /* * Clear the LRU lists so pages can be isolated. @@ -71,16 +71,12 @@ int migrate_prep(void) * pages that may be busy. */ lru_add_drain_all(); - - return 0; } /* Do the necessary work of migrate_prep but not if it involves other CPUs */ -int migrate_prep_local(void) +void migrate_prep_local(void) { lru_add_drain(); - - return 0; } int isolate_movable_page(struct page *page, isolate_mode_t mode)