From patchwork Thu Jul 23 03:22:45 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Baoquan He X-Patchwork-Id: 11679803 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 2D03713A4 for ; Thu, 23 Jul 2020 03:23:07 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id E116120771 for ; Thu, 23 Jul 2020 03:23:06 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="U7pm2mTO" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E116120771 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 B75136B0007; Wed, 22 Jul 2020 23:23:03 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id B25286B0008; Wed, 22 Jul 2020 23:23:03 -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 A39E06B000A; Wed, 22 Jul 2020 23:23:03 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0028.hostedemail.com [216.40.44.28]) by kanga.kvack.org (Postfix) with ESMTP id 8F14D6B0007 for ; Wed, 22 Jul 2020 23:23:03 -0400 (EDT) Received: from smtpin09.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 5009AAA178 for ; Thu, 23 Jul 2020 03:23:03 +0000 (UTC) X-FDA: 77067894246.09.mouth86_131159726f3b Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin09.hostedemail.com (Postfix) with ESMTP id 25EF31803016E for ; Thu, 23 Jul 2020 03:23:03 +0000 (UTC) X-Spam-Summary: 1,0,0,,d41d8cd98f00b204,bhe@redhat.com,,RULES_HIT:30054:30064,0,RBL:207.211.31.120:@redhat.com:.lbl8.mailshell.net-62.18.0.100 66.10.201.10;04ygz6pm73zcmomx6xraboh113t5dycskh5ojjop3m9jgssqd4b35cioe66dodb.t7icbsag8yeh6zskfqpkbkp1t8fj7ric665dg1fe8znmxxngy9ghwh8s6y5eqmc.w-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:24,LUA_SUMMARY:none X-HE-Tag: mouth86_131159726f3b X-Filterd-Recvd-Size: 2906 Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) by imf49.hostedemail.com (Postfix) with ESMTP for ; Thu, 23 Jul 2020 03:23:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1595474582; 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=BTooNJ31kedJqWj3+6eiTB1g4irFJns6s4pfKDa5+oE=; b=U7pm2mTO23T6HlRyluaaV7O+42ChAvsq3vLt8EaDu8kROiEi/HJYLJUmZC0BQ3NMTwJw8z yDcRGdXkilaXUoqdkKX0utUUKxrf03lyI9DSgs9svbW4JTBg2sXHG+i16drb2Z4Wki8Gby 5mx1D6oJ8PgdGROI+SaTm5Zaiwux3/o= 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-291-73hxUGVFM926SAg8fmk1KQ-1; Wed, 22 Jul 2020 23:22:59 -0400 X-MC-Unique: 73hxUGVFM926SAg8fmk1KQ-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id D3E578017FB; Thu, 23 Jul 2020 03:22:58 +0000 (UTC) Received: from MiWiFi-R3L-srv.redhat.com (ovpn-13-53.pek2.redhat.com [10.72.13.53]) by smtp.corp.redhat.com (Postfix) with ESMTP id 8087E69316; Thu, 23 Jul 2020 03:22:56 +0000 (UTC) From: Baoquan He To: linux-kernel@vger.kernel.org Cc: linux-mm@kvack.org, mike.kravetz@oracle.com, david@redhat.com, akpm@linux-foundation.org, bhe@redhat.com Subject: [PATCH v2 1/4] mm/hugetlb.c: make is_hugetlb_entry_hwpoisoned return bool Date: Thu, 23 Jul 2020 11:22:45 +0800 Message-Id: <20200723032248.24772-2-bhe@redhat.com> In-Reply-To: <20200723032248.24772-1-bhe@redhat.com> References: <20200723032248.24772-1-bhe@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Rspamd-Queue-Id: 25EF31803016E X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam01 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 its neighbour is_hugetlb_entry_migration() has done. Signed-off-by: Baoquan He Reviewed-by: Mike Kravetz Reviewed-by: David Hildenbrand Reviewed-by: Anshuman Khandual --- mm/hugetlb.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/mm/hugetlb.c b/mm/hugetlb.c index f24acb3af741..3569e731e66b 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, From patchwork Thu Jul 23 03:22:46 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Baoquan He X-Patchwork-Id: 11679805 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 C2DAE13A4 for ; Thu, 23 Jul 2020 03:23:09 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 84BE420771 for ; Thu, 23 Jul 2020 03:23:09 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="HXsmYVna" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 84BE420771 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 4E71C6B0008; Wed, 22 Jul 2020 23:23:08 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 495E06B000A; Wed, 22 Jul 2020 23:23:08 -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 3AFFC6B000C; Wed, 22 Jul 2020 23:23:08 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0105.hostedemail.com [216.40.44.105]) by kanga.kvack.org (Postfix) with ESMTP id 1FCA46B0008 for ; Wed, 22 Jul 2020 23:23:08 -0400 (EDT) Received: from smtpin12.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id C646E1806510A for ; Thu, 23 Jul 2020 03:23:07 +0000 (UTC) X-FDA: 77067894414.12.steam94_5c0ad0126f3b Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin12.hostedemail.com (Postfix) with ESMTP id 9075918185884 for ; Thu, 23 Jul 2020 03:23:07 +0000 (UTC) X-Spam-Summary: 1,0,0,,d41d8cd98f00b204,bhe@redhat.com,,RULES_HIT:30012:30054:30064:30070,0,RBL:207.211.31.81:@redhat.com:.lbl8.mailshell.net-66.10.201.10 62.18.0.100;04yrmteq7dqse9iso1e4pdrrp3jeyyc355uhx9nwn3brenbiurbc13xi54p19bp.iccruthc98zwferm5t6r9jjrf6k7y1mr6bodepsn6i9cbnrkjwd3e1jhq5xypgs.1-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:24,LUA_SUMMARY:none X-HE-Tag: steam94_5c0ad0126f3b X-Filterd-Recvd-Size: 3190 Received: from us-smtp-delivery-1.mimecast.com (us-smtp-2.mimecast.com [207.211.31.81]) by imf10.hostedemail.com (Postfix) with ESMTP for ; Thu, 23 Jul 2020 03:23:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1595474586; 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=Ts3Ck5YAmU7JalAJmJ/D595ycdEdSJmjE5GqTZJjOAQ=; b=HXsmYVna0B8Y4s3INsQTncmAJ1aAabgL+CCsbxWucRNH90s3vu/QM8LwvX8HvuRy10+KM1 j9cbLt8Vyn7HpumGOBSBSA241N2KpB8BphhV47bxalhsvD2KVm9BUmIdtH04F10vptIfTS 9bKoyHVO0ZLc2MkL96WSXYHmHqLTCuk= 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-25-_jNFcJilPsGYdDK8wZDmug-1; Wed, 22 Jul 2020 23:23:02 -0400 X-MC-Unique: _jNFcJilPsGYdDK8wZDmug-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 99F85106B243; Thu, 23 Jul 2020 03:23:01 +0000 (UTC) Received: from MiWiFi-R3L-srv.redhat.com (ovpn-13-53.pek2.redhat.com [10.72.13.53]) by smtp.corp.redhat.com (Postfix) with ESMTP id 696F65C1BD; Thu, 23 Jul 2020 03:22:59 +0000 (UTC) From: Baoquan He To: linux-kernel@vger.kernel.org Cc: linux-mm@kvack.org, mike.kravetz@oracle.com, david@redhat.com, akpm@linux-foundation.org, bhe@redhat.com Subject: [PATCH v2 2/4] mm/hugetlb.c: Remove the unnecessary non_swap_entry() Date: Thu, 23 Jul 2020 11:22:46 +0800 Message-Id: <20200723032248.24772-3-bhe@redhat.com> In-Reply-To: <20200723032248.24772-1-bhe@redhat.com> References: <20200723032248.24772-1-bhe@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Rspamd-Queue-Id: 9075918185884 X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam03 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 checking is_migration_entry() and is_hwpoison_entry() are stricter than non_swap_entry(), means they have covered the conditional check which non_swap_entry() is doing. Hence remove the unnecessary non_swap_entry() in is_hugetlb_entry_migration() and is_hugetlb_entry_hwpoisoned() to simplify code. Signed-off-by: Baoquan He Reviewed-by: Mike Kravetz Reviewed-by: David Hildenbrand Reviewed-by: Anshuman Khandual --- mm/hugetlb.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mm/hugetlb.c b/mm/hugetlb.c index 3569e731e66b..c14837854392 100644 --- a/mm/hugetlb.c +++ b/mm/hugetlb.c @@ -3748,7 +3748,7 @@ bool is_hugetlb_entry_migration(pte_t pte) if (huge_pte_none(pte) || pte_present(pte)) return false; swp = pte_to_swp_entry(pte); - if (non_swap_entry(swp) && is_migration_entry(swp)) + if (is_migration_entry(swp)) return true; else return false; @@ -3761,7 +3761,7 @@ static bool is_hugetlb_entry_hwpoisoned(pte_t pte) if (huge_pte_none(pte) || pte_present(pte)) return false; swp = pte_to_swp_entry(pte); - if (non_swap_entry(swp) && is_hwpoison_entry(swp)) + if (is_hwpoison_entry(swp)) return true; else return false; From patchwork Thu Jul 23 03:22:47 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Baoquan He X-Patchwork-Id: 11679807 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 C6D3413B4 for ; Thu, 23 Jul 2020 03:23:12 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 8D3B0207E8 for ; Thu, 23 Jul 2020 03:23:12 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="HFGhCOo8" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8D3B0207E8 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 7CC3B6B000C; Wed, 22 Jul 2020 23:23:11 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 77B206B000D; Wed, 22 Jul 2020 23:23:11 -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 66C9C6B000E; Wed, 22 Jul 2020 23:23:11 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0164.hostedemail.com [216.40.44.164]) by kanga.kvack.org (Postfix) with ESMTP id 50E8E6B000C for ; Wed, 22 Jul 2020 23:23:11 -0400 (EDT) Received: from smtpin03.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 11CC718037BDA for ; Thu, 23 Jul 2020 03:23:11 +0000 (UTC) X-FDA: 77067894582.03.lace06_580680626f3b Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin03.hostedemail.com (Postfix) with ESMTP id DD32713EE7 for ; Thu, 23 Jul 2020 03:23:10 +0000 (UTC) X-Spam-Summary: 1,0,0,,d41d8cd98f00b204,bhe@redhat.com,,RULES_HIT:30034:30054:30064:30070,0,RBL:207.211.31.81:@redhat.com:.lbl8.mailshell.net-62.18.0.100 66.10.201.10;04ygz7i9fnkatpp91buw4eoknsm37yputowc79mpguq89hjjk9u86et9oznp9u5.ipxwmbfu7ooi83i5935qc31w73tmue5m57bqij3k5mfx8zim7sp3ygfkz14ytw4.n-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: lace06_580680626f3b X-Filterd-Recvd-Size: 2941 Received: from us-smtp-delivery-1.mimecast.com (us-smtp-1.mimecast.com [207.211.31.81]) by imf01.hostedemail.com (Postfix) with ESMTP for ; Thu, 23 Jul 2020 03:23:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1595474589; 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=NDgoEGWosDZ+OM1ZqFdb1fsmC8c2DTCKfhr+32UzbUM=; b=HFGhCOo8Q8Tmz/vLKiLls+W5fpIl5ZvFHDvxLqawVdFFfOXiDOhyEDDEed32mOv1pH9am2 jeSLzX4WRn41uQiSNMcF0AKUkvFDt81DTCaRbin0DRXVJhPT9Gkps+gvH+8UveUz7u9jhg 44BfHvXe3Q2skKxb7JagMjEpnetIzTU= 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-381-SHZaXwHgMGind-VCYjSQOg-1; Wed, 22 Jul 2020 23:23:05 -0400 X-MC-Unique: SHZaXwHgMGind-VCYjSQOg-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 5406118A1DF4; Thu, 23 Jul 2020 03:23:04 +0000 (UTC) Received: from MiWiFi-R3L-srv.redhat.com (ovpn-13-53.pek2.redhat.com [10.72.13.53]) by smtp.corp.redhat.com (Postfix) with ESMTP id 24C845C1BD; Thu, 23 Jul 2020 03:23:01 +0000 (UTC) From: Baoquan He To: linux-kernel@vger.kernel.org Cc: linux-mm@kvack.org, mike.kravetz@oracle.com, david@redhat.com, akpm@linux-foundation.org, bhe@redhat.com Subject: [PATCH v2 3/4] doc/vm: fix typo in the hugetlb admin documentation Date: Thu, 23 Jul 2020 11:22:47 +0800 Message-Id: <20200723032248.24772-4-bhe@redhat.com> In-Reply-To: <20200723032248.24772-1-bhe@redhat.com> References: <20200723032248.24772-1-bhe@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Rspamd-Queue-Id: DD32713EE7 X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam03 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: Change 'pecify' to 'Specify'. Signed-off-by: Baoquan He Reviewed-by: Mike Kravetz Reviewed-by: David Hildenbrand --- Documentation/admin-guide/mm/hugetlbpage.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Documentation/admin-guide/mm/hugetlbpage.rst b/Documentation/admin-guide/mm/hugetlbpage.rst index 015a5f7d7854..f7b1c7462991 100644 --- a/Documentation/admin-guide/mm/hugetlbpage.rst +++ b/Documentation/admin-guide/mm/hugetlbpage.rst @@ -131,7 +131,7 @@ hugepages parameter is preceded by an invalid hugepagesz parameter, it will be ignored. default_hugepagesz - pecify the default huge page size. This parameter can + Specify the default huge page size. This parameter can only be specified once on the command line. default_hugepagesz can optionally be followed by the hugepages parameter to preallocate a specific number of huge pages of default size. The number of default From patchwork Thu Jul 23 03:22:48 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Baoquan He X-Patchwork-Id: 11679809 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 14DD413A4 for ; Thu, 23 Jul 2020 03:23:19 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id D57E720771 for ; Thu, 23 Jul 2020 03:23:18 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="Di2sfwnR" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D57E720771 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 1632E6B000D; Wed, 22 Jul 2020 23:23:18 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 113AB6B000E; Wed, 22 Jul 2020 23:23:18 -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 002E46B0010; Wed, 22 Jul 2020 23:23:17 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0144.hostedemail.com [216.40.44.144]) by kanga.kvack.org (Postfix) with ESMTP id DF1E86B000D for ; Wed, 22 Jul 2020 23:23:17 -0400 (EDT) Received: from smtpin20.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 988A0A03A9 for ; Thu, 23 Jul 2020 03:23:17 +0000 (UTC) X-FDA: 77067894834.20.crown01_2a01df226f3b Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin20.hostedemail.com (Postfix) with ESMTP id 07D841802E2AF for ; Thu, 23 Jul 2020 03:23:13 +0000 (UTC) X-Spam-Summary: 1,0,0,,d41d8cd98f00b204,bhe@redhat.com,,RULES_HIT:30012:30034:30054:30056:30090,0,RBL:205.139.110.120:@redhat.com:.lbl8.mailshell.net-66.10.201.10 62.18.0.100;04y89fobexunuw6n5grtacjnib8j1ypmwkgzmdaupkdajfy8d9hwq3733dirtgc.ms39517jgg5z8g16zisr8yxtbu8uspm8ooxuqpwzcbnihzfnocf4qyifhd67d6q.k-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: crown01_2a01df226f3b X-Filterd-Recvd-Size: 4146 Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) by imf24.hostedemail.com (Postfix) with ESMTP for ; Thu, 23 Jul 2020 03:23:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1595474591; 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=vZfw7dyC3KMlWpgvlscO0Ovg3J13CbQcaPM0NJVPAbM=; b=Di2sfwnR1AMOqPJzWcLYYqR6DoWAR0jdQ/VZ7/JxHBcHrIX71U5lOs2CRImDfEzmLYmaFX NriphDDUgF8ugsqLJgPiPp6fBsjjE0PFoCbm5/NGRm7VTGDqvzwEw+eGlw9ld2xvcexynf mvJyvvXpdMhptrw9GFv1pU9miGN4tMQ= 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-52-5xsT3EbkOIGbJy9TKANloQ-1; Wed, 22 Jul 2020 23:23:09 -0400 X-MC-Unique: 5xsT3EbkOIGbJy9TKANloQ-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 7F6E518A1DED; Thu, 23 Jul 2020 03:23:08 +0000 (UTC) Received: from MiWiFi-R3L-srv.redhat.com (ovpn-13-53.pek2.redhat.com [10.72.13.53]) by smtp.corp.redhat.com (Postfix) with ESMTP id D51825C1BD; Thu, 23 Jul 2020 03:23:04 +0000 (UTC) From: Baoquan He To: linux-kernel@vger.kernel.org Cc: linux-mm@kvack.org, mike.kravetz@oracle.com, david@redhat.com, akpm@linux-foundation.org, bhe@redhat.com Subject: [PATCH v2 4/4] mm/hugetl.c: warn out if expected count of huge pages adjustment is not achieved Date: Thu, 23 Jul 2020 11:22:48 +0800 Message-Id: <20200723032248.24772-5-bhe@redhat.com> In-Reply-To: <20200723032248.24772-1-bhe@redhat.com> References: <20200723032248.24772-1-bhe@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Rspamd-Queue-Id: 07D841802E2AF X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam05 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: A customer complained that no message is logged when the number of persistent huge pages is not changed to the exact value written to the sysfs or proc nr_hugepages file. In the current code, a best effort is made to satisfy requests made via the nr_hugepages file. However, requests may be only partially satisfied. Log a message if the code was unsuccessful in fully satisfying a request. This includes both increasing and decreasing the number of persistent huge pages. Signed-off-by: Baoquan He --- mm/hugetlb.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/mm/hugetlb.c b/mm/hugetlb.c index c14837854392..b5aa32a13569 100644 --- a/mm/hugetlb.c +++ b/mm/hugetlb.c @@ -2661,7 +2661,7 @@ static int adjust_pool_surplus(struct hstate *h, nodemask_t *nodes_allowed, static int set_max_huge_pages(struct hstate *h, unsigned long count, int nid, nodemask_t *nodes_allowed) { - unsigned long min_count, ret; + unsigned long min_count, ret, old_max, new_max; NODEMASK_ALLOC(nodemask_t, node_alloc_noretry, GFP_KERNEL); /* @@ -2723,6 +2723,7 @@ static int set_max_huge_pages(struct hstate *h, unsigned long count, int nid, * pool might be one hugepage larger than it needs to be, but * within all the constraints specified by the sysctls. */ + old_max = persistent_huge_pages(h); while (h->surplus_huge_pages && count > persistent_huge_pages(h)) { if (!adjust_pool_surplus(h, nodes_allowed, -1)) break; @@ -2779,8 +2780,20 @@ static int set_max_huge_pages(struct hstate *h, unsigned long count, int nid, } out: h->max_huge_pages = persistent_huge_pages(h); + new_max = h->max_huge_pages; spin_unlock(&hugetlb_lock); + if (count != new_max) { + char buf[32]; + + string_get_size(huge_page_size(h), 1, STRING_UNITS_2, buf, 32); + pr_warn("HugeTLB: %s %lu of page size %s failed. Only %s %lu hugepages.\n", + count > old_max ? "increasing" : "decreasing", + abs(count - old_max), buf, + count > old_max ? "increased" : "decreased", + abs(old_max - new_max)); + } + NODEMASK_FREE(node_alloc_noretry); return 0;