From patchwork Tue Nov 10 18:12:49 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yang Shi X-Patchwork-Id: 11895011 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 04B2016C1 for ; Tue, 10 Nov 2020 18:13:14 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id B415220674 for ; Tue, 10 Nov 2020 18:13:13 +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="I1r4bpBe" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B415220674 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 5D72E6B0072; Tue, 10 Nov 2020 13:13:12 -0500 (EST) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 587956B0074; Tue, 10 Nov 2020 13:13:12 -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 3FCBC6B0075; Tue, 10 Nov 2020 13:13:12 -0500 (EST) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0084.hostedemail.com [216.40.44.84]) by kanga.kvack.org (Postfix) with ESMTP id 135B86B0072 for ; Tue, 10 Nov 2020 13:13:12 -0500 (EST) Received: from smtpin08.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id B012A824999B for ; Tue, 10 Nov 2020 18:13:11 +0000 (UTC) X-FDA: 77469305382.08.jewel34_431201f272f7 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin08.hostedemail.com (Postfix) with ESMTP id 8FD361819E764 for ; Tue, 10 Nov 2020 18:13:11 +0000 (UTC) X-Spam-Summary: 1,0,0,3c832f54ecdb5acc,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:14687:14721:21060:21080:21444:21627:21666:21740:21990:30054:30064:30070:30090,0,RBL:209.85.214.193:@gmail.com:.lbl8.mailshell.net-62.50.0.100 66.100.201.100;04yrbcu7tdj6d6bix9m5marcmrtoqypeoqea4u849pr6n5q5wk4ybn677ah16gc.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:69,LUA_SUMMARY:none X-HE-Tag: jewel34_431201f272f7 X-Filterd-Recvd-Size: 5599 Received: from mail-pl1-f193.google.com (mail-pl1-f193.google.com [209.85.214.193]) by imf28.hostedemail.com (Postfix) with ESMTP for ; Tue, 10 Nov 2020 18:13:10 +0000 (UTC) Received: by mail-pl1-f193.google.com with SMTP id k7so6889603plk.3 for ; Tue, 10 Nov 2020 10:13:10 -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=METT62l5bl1QOeNAT1zAxW9WSJIbbi+SftVWPulzf3A=; b=I1r4bpBeciZdhrdMeQwTpQtdYv/5vYY/Lb31pwQy2h56pSZowU/JX8kxfxQ4lrfgy8 4GeJLASRCwf9/CfBBN37pB/NeapqGvnF9e2Z6JL58jYQSaIetWzu02c6HH8CwCCebg1/ u/lxKclSTnO0zibDO+sz7Mj8W0MfHjwGd3dif6mtMLo2hdIzh9fH3Y2MFDvnViubY+XB 8aK09OfEyhC57jPykdZ+so0AZJf4Xh6ZuaaKRbc+8mvvHVKH+7apZZX7W+QlCRGHrVRO Y2sVem3sDPsiPBbmKdR8VrakHmZ7Et6+DjFi9UYXxf3PTEjujv0QXBikJcUxNp/7UWyk dvNw== 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=METT62l5bl1QOeNAT1zAxW9WSJIbbi+SftVWPulzf3A=; b=Yn4hDZlz6JLaRDNx90Gn7oqd5Iby6N02HIQ/NgTwNbdZMHhI7z4Sq66X6MaDw6MfSm HC6RkWyL3QAGOIocJgkudh/Tj+U7W/Zksw7YJGyX5HrpeOH1ktNhbJWW/+OUBBQvtYKQ miAdokZ30WUn+xNo6yW/JkPnA6mCxm7dl0NjJeu7aPZPdnFfSH3DtbRFOIFDDyifd2TZ DIZh/yfhLsM+JXpIJ+Ek522GxqZysJCw/1ou1t6Kwmyp9qZfiYZOg8LBisT/jOQwoyhy rvLNGBdRqQCecPG/kmTv37oSymQmmf6dIbqjTg1ZxoPzpG3yP7iOtzWAdoVlCfZDAfUO +qoQ== X-Gm-Message-State: AOAM533q7VOjUvYqFBl7K9wAL0x5QNLiFy7hQQwhESw0ems7vKGXDojv yD5D6fwshUia/FCGDC5AYLA= X-Google-Smtp-Source: ABdhPJwo/sGFSUG1Jh6oyERIbbJeS18FFBCXGxTR+9l230LLSqNwItQ5DiwkzTpfym9jNhWf7icmjg== X-Received: by 2002:a17:902:56d:b029:d7:c927:2e51 with SMTP id 100-20020a170902056db02900d7c9272e51mr15637869plf.27.1605031990148; Tue, 10 Nov 2020 10:13:10 -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 k5sm4157369pjj.37.2020.11.10.10.13.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Nov 2020 10:13:09 -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: [v2 PATCH 4/5] mm: migrate: clean up migrate_prep{_local} Date: Tue, 10 Nov 2020 10:12:49 -0800 Message-Id: <20201110181250.264394-5-shy828301@gmail.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20201110181250.264394-1-shy828301@gmail.com> References: <20201110181250.264394-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. Reviewed-by: Zi Yan 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 3ca4898f3f24..8cf96bd21341 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 1b103e801fe4..693bf06448ad 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)