From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.5 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,NICE_REPLY_A, SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1DCA4C433DB for ; Thu, 25 Mar 2021 13:18:29 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id AA462619CB for ; Thu, 25 Mar 2021 13:18:28 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org AA462619CB Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 4AAB46B0070; Thu, 25 Mar 2021 09:18:28 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 480806B0071; Thu, 25 Mar 2021 09:18:28 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 348976B0072; Thu, 25 Mar 2021 09:18:28 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0024.hostedemail.com [216.40.44.24]) by kanga.kvack.org (Postfix) with ESMTP id 18CAA6B0070 for ; Thu, 25 Mar 2021 09:18:28 -0400 (EDT) Received: from smtpin21.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id D30DF824C427 for ; Thu, 25 Mar 2021 13:18:27 +0000 (UTC) X-FDA: 77958450654.21.96EC1B6 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by imf03.hostedemail.com (Postfix) with ESMTP id A063AC000C44 for ; Thu, 25 Mar 2021 13:18:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1616678303; h=from:from: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=uSM6XsoCExKe4rLBLCAD8bfv90jOFRgqC0PeCEkln9I=; b=L16bVYI+htztROes7dBFYVQbf93mPkr8pm9CyNYVHtkfmexqZyGfYMaP8NWAJf6oByx3EQ h9SkRUznHqygYcBlG0YwT95g8I4HOL9WdGcNekfspfGftLLOP7Dif/jQmu0Hl5cbp4xiH0 11jUAhddKvEjb+Y2tC0DWtEUlkbVjPg= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-149-Djy4CsTBNNiX3Lo24tAg5g-1; Thu, 25 Mar 2021 09:18:18 -0400 X-MC-Unique: Djy4CsTBNNiX3Lo24tAg5g-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 2975994F1A; Thu, 25 Mar 2021 13:17:19 +0000 (UTC) Received: from [10.36.115.72] (ovpn-115-72.ams2.redhat.com [10.36.115.72]) by smtp.corp.redhat.com (Postfix) with ESMTP id EEC605D9CA; Thu, 25 Mar 2021 13:17:16 +0000 (UTC) Subject: Re: [PATCH v3 1/5] mm/migrate.c: make putback_movable_page() static To: Miaohe Lin , akpm@linux-foundation.org Cc: jglisse@redhat.com, shy828301@gmail.com, aquini@redhat.com, apopple@nvidia.com, linux-kernel@vger.kernel.org, linux-mm@kvack.org References: <20210325131524.48181-1-linmiaohe@huawei.com> <20210325131524.48181-2-linmiaohe@huawei.com> From: David Hildenbrand Organization: Red Hat GmbH Message-ID: Date: Thu, 25 Mar 2021 14:17:15 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.8.0 MIME-Version: 1.0 In-Reply-To: <20210325131524.48181-2-linmiaohe@huawei.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: A063AC000C44 X-Stat-Signature: duh7pcfoxw7sa8s8ss8d7ie3kwdewoq1 Received-SPF: none (redhat.com>: No applicable sender policy available) receiver=imf03; identity=mailfrom; envelope-from=""; helo=us-smtp-delivery-124.mimecast.com; client-ip=216.205.24.124 X-HE-DKIM-Result: pass/pass X-HE-Tag: 1616678303-87531 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: On 25.03.21 14:15, Miaohe Lin wrote: > The putback_movable_page() is just called by putback_movable_pages() and > we know the page is locked and both PageMovable() and PageIsolated() is > checked right before calling putback_movable_page(). So we make it static > and remove all the 3 VM_BUG_ON_PAGE(). > > Signed-off-by: Miaohe Lin > --- > include/linux/migrate.h | 1 - > mm/migrate.c | 7 +------ > 2 files changed, 1 insertion(+), 7 deletions(-) > > diff --git a/include/linux/migrate.h b/include/linux/migrate.h > index fdf65f23acec..1d8095069b1c 100644 > --- a/include/linux/migrate.h > +++ b/include/linux/migrate.h > @@ -44,7 +44,6 @@ extern int migrate_pages(struct list_head *l, new_page_t new, free_page_t free, > unsigned long private, enum migrate_mode mode, int reason); > extern struct page *alloc_migration_target(struct page *page, unsigned long private); > extern int isolate_movable_page(struct page *page, isolate_mode_t mode); > -extern void putback_movable_page(struct page *page); > > extern void migrate_prep(void); > extern void migrate_prep_local(void); > diff --git a/mm/migrate.c b/mm/migrate.c > index 47df0df8f21a..61e7f848b554 100644 > --- a/mm/migrate.c > +++ b/mm/migrate.c > @@ -140,15 +140,10 @@ int isolate_movable_page(struct page *page, isolate_mode_t mode) > return -EBUSY; > } > > -/* It should be called on page which is PG_movable */ > -void putback_movable_page(struct page *page) > +static void putback_movable_page(struct page *page) > { > struct address_space *mapping; > > - VM_BUG_ON_PAGE(!PageLocked(page), page); > - VM_BUG_ON_PAGE(!PageMovable(page), page); > - VM_BUG_ON_PAGE(!PageIsolated(page), page); > - > mapping = page_mapping(page); > mapping->a_ops->putback_page(page); > __ClearPageIsolated(page); > Reviewed-by: David Hildenbrand -- Thanks, David / dhildenb