From patchwork Fri Nov 13 20:53:58 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yang Shi X-Patchwork-Id: 11904565 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 585B8697 for ; Fri, 13 Nov 2020 20:54:26 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 1A6D822255 for ; Fri, 13 Nov 2020 20:54:25 +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="FWbOftTw" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1A6D822255 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 112376B0075; Fri, 13 Nov 2020 15:54:25 -0500 (EST) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 0C2E96B0078; Fri, 13 Nov 2020 15:54:25 -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 E56766B007B; Fri, 13 Nov 2020 15:54:24 -0500 (EST) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0052.hostedemail.com [216.40.44.52]) by kanga.kvack.org (Postfix) with ESMTP id B68506B0075 for ; Fri, 13 Nov 2020 15:54:24 -0500 (EST) Received: from smtpin22.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 4A2908249980 for ; Fri, 13 Nov 2020 20:54:24 +0000 (UTC) X-FDA: 77480598048.22.rock58_110dbb227312 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin22.hostedemail.com (Postfix) with ESMTP id 2A9BD18038E67 for ; Fri, 13 Nov 2020 20:54:24 +0000 (UTC) X-Spam-Summary: 1,0,0,bdf4af87ac5c836c,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.215.194:@gmail.com:.lbl8.mailshell.net-66.100.201.100 62.18.0.100;04yft4aw9epy48dkuw9asy869s87dypeoqea4u849pr6n5q5wk4ybn677ah16gc.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:71,LUA_SUMMARY:none X-HE-Tag: rock58_110dbb227312 X-Filterd-Recvd-Size: 5575 Received: from mail-pg1-f194.google.com (mail-pg1-f194.google.com [209.85.215.194]) by imf21.hostedemail.com (Postfix) with ESMTP for ; Fri, 13 Nov 2020 20:54:23 +0000 (UTC) Received: by mail-pg1-f194.google.com with SMTP id h6so8071505pgk.4 for ; Fri, 13 Nov 2020 12:54:23 -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=NlCySaarQuBRqx4ZarxGkk5wyOoOIoY4LEnvGt+q/V8=; b=FWbOftTweAh9DsE1ejLx5Hj3jf3rfjvcSWPSDIPv0iHC9LP3BmDaa0znpjQG0Nuynu APq3xUhBOA52WhIlJuoBeDVb5kRULJS097Yh1I1K8OQc88hAcDET1v2MR2JrEkj4MmKc 6/EZwRmqUA6QebJmH9dg+pwDo9vufW81WRuy/BW+G/QzFlWCmL4e7c1n6wpVZPp2nz+y qoyvjxWFLR3BQpvRZzZKkwxT45OIDLWaMiWEIkUMGu5mSr9JjuMCV5fDUnSNyruRxuA8 gBfms96UIGgIdYGDpuEe5+4JWsqdXvU6VVSnovz8kwPLuuvxt3YrdcaIBthenUBQOLnZ vBsw== 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=NlCySaarQuBRqx4ZarxGkk5wyOoOIoY4LEnvGt+q/V8=; b=sO37lYW4TLWp1ujeT5bo9dCWwOMbwc7arlBxRgDWByXjXyqd8VaOYP4AX573VU2KNh 0PbeIFm8SR868kGEE84KUgbR+bFCgKoX8izCezWBoY8dUdOk45jF3Wkk2Xa3jgZsFH6G qTRkyQBgWipny8c1WvOgxvap8b00VTcxe7QWHXjLG0MNaPhcehvYAC5JKrqTVcfVEiPF mWkex+3KjtpScc5p1gpUnPCGkXXci3K37J4QNb/raZgFaD1YhaDe676JJsQj3u9oY2HI 6STXROSIY6+JYZ2wNnBs7L5MDfZ+nSHI99bUm71H7Qb41Hl3Iu0vzQetnknNbUf8675H 2JsA== X-Gm-Message-State: AOAM531GTWtyh6YG+aH/5q0OxS1Kdlzmp7A1QEDIk3idwY/xHP9Hrtcj UWijDQOqzwCdmZFiRX/Co78= X-Google-Smtp-Source: ABdhPJxnzIuqoEzeSjtKEmms0/Rel0ToY3PHomWAvPB4LIt6hlhlCX+b1+j14OZ/MnPJDvulD+LRkw== X-Received: by 2002:a17:90a:1696:: with SMTP id o22mr4768923pja.44.1605300862975; Fri, 13 Nov 2020 12:54:22 -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 a18sm3780234pfa.151.2020.11.13.12.54.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Nov 2020 12:54:21 -0800 (PST) From: Yang Shi To: mhocko@suse.com, ziy@nvidia.com, songliubraving@fb.com, mgorman@suse.de, jack@suse.cz, willy@infradead.org, akpm@linux-foundation.org Cc: shy828301@gmail.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: [v3 PATCH 4/5] mm: migrate: clean up migrate_prep{_local} Date: Fri, 13 Nov 2020 12:53:58 -0800 Message-Id: <20201113205359.556831-5-shy828301@gmail.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20201113205359.556831-1-shy828301@gmail.com> References: <20201113205359.556831-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 18cc1ef0e447..4d3d173a1706 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)