From patchwork Mon Jul 20 06:26:20 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Baoquan He X-Patchwork-Id: 11672919 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 6AA3913B4 for ; Mon, 20 Jul 2020 06:26:51 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 3725D22482 for ; Mon, 20 Jul 2020 06:26:51 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="Uq776Kty" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3725D22482 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 3A1D78D0003; Mon, 20 Jul 2020 02:26:50 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 352E68D0001; Mon, 20 Jul 2020 02:26:50 -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 268D18D0003; Mon, 20 Jul 2020 02:26:50 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0226.hostedemail.com [216.40.44.226]) by kanga.kvack.org (Postfix) with ESMTP id 0B3508D0001 for ; Mon, 20 Jul 2020 02:26:50 -0400 (EDT) Received: from smtpin27.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id B8159183956F7 for ; Mon, 20 Jul 2020 06:26:49 +0000 (UTC) X-FDA: 77057470938.27.play42_381583726f22 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin27.hostedemail.com (Postfix) with ESMTP id F248717EBD for ; Mon, 20 Jul 2020 06:26:35 +0000 (UTC) X-Spam-Summary: 1,0,0,,d41d8cd98f00b204,bhe@redhat.com,,RULES_HIT:30054,0,RBL:205.139.110.61:@redhat.com:.lbl8.mailshell.net-62.18.0.100 66.10.201.10;04y8jpiqn6igfftt8rxkayjams8amycnfwy4tg1yitm8ugo6jkhsnbe193eaq8y.dxokisag8yeh6zskfqpkbkp1t8fj7ric665srk595518o1ug86sksjxh5ifqb3c.e-lbl8.mailshell.net-223.238.255.100,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:ft,MSBL:0,DNSBL:neutral,Custom_rules:0:0:0,LFtime:23,LUA_SUMMARY:none X-HE-Tag: play42_381583726f22 X-Filterd-Recvd-Size: 2779 Received: from us-smtp-delivery-1.mimecast.com (us-smtp-2.mimecast.com [205.139.110.61]) by imf30.hostedemail.com (Postfix) with ESMTP for ; Mon, 20 Jul 2020 06:26:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1595226395; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:in-reply-to:in-reply-to:references:references; bh=HZVpm4zvUxz3yqhYdW0O0x6jO3M2RU27CaJXZlinWJc=; b=Uq776KtyfAozjSAaDLlUTDR5/eKxFnPSD60Kh/SYgXjcrm8eexdH+JLgSmCnLO3a00o7vC Z/oXaR91uifPzRPAUisZb/vVCAijNfVQf2YAh/v/IIwtOnPlvQd3WIhh3ffri6+OiWOMak tGvYJRqGJe6mCIGW8bm4Qvlqb3gUV8k= 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-262-pmyWS8elN5qfgagnssZLaA-1; Mon, 20 Jul 2020 02:26:33 -0400 X-MC-Unique: pmyWS8elN5qfgagnssZLaA-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 0A7EE1080; Mon, 20 Jul 2020 06:26:32 +0000 (UTC) Received: from MiWiFi-R3L-srv.redhat.com (ovpn-12-150.pek2.redhat.com [10.72.12.150]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1D46678526; Mon, 20 Jul 2020 06:26:29 +0000 (UTC) From: Baoquan He To: linux-kernel@vger.kernel.org Cc: linux-mm@kvack.org, mike.kravetz@oracle.com, akpm@linux-foundation.org, bhe@redhat.com Subject: [PATCH 2/5] mm/hugetlb.c: make is_hugetlb_entry_hwpoisoned return bool Date: Mon, 20 Jul 2020 14:26:20 +0800 Message-Id: <20200720062623.13135-3-bhe@redhat.com> In-Reply-To: <20200720062623.13135-1-bhe@redhat.com> References: <20200720062623.13135-1-bhe@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Rspamd-Queue-Id: F248717EBD X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam02 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: Just like his neighbour is_hugetlb_entry_migration() has done. Signed-off-by: Baoquan He Reviewed-by: Mike Kravetz Reviewed-by: David Hildenbrand --- mm/hugetlb.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/mm/hugetlb.c b/mm/hugetlb.c index 191a585bb315..a58f976a9dd9 100644 --- a/mm/hugetlb.c +++ b/mm/hugetlb.c @@ -3754,17 +3754,17 @@ bool is_hugetlb_entry_migration(pte_t pte) return false; } -static int is_hugetlb_entry_hwpoisoned(pte_t pte) +static bool is_hugetlb_entry_hwpoisoned(pte_t pte) { swp_entry_t swp; if (huge_pte_none(pte) || pte_present(pte)) - return 0; + return false; swp = pte_to_swp_entry(pte); if (non_swap_entry(swp) && is_hwpoison_entry(swp)) - return 1; + return true; else - return 0; + return false; } int copy_hugetlb_page_range(struct mm_struct *dst, struct mm_struct *src,