Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp1541943ybh; Thu, 23 Jul 2020 11:24:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyKuk/EnbRe7y6IGfKMBLDkHF882ONI30WhunQ7V0EEQlWjHkn5hwf1K6eISQmyPJrKtMNO X-Received: by 2002:aa7:cdca:: with SMTP id h10mr5512366edw.285.1595528689247; Thu, 23 Jul 2020 11:24:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595528689; cv=none; d=google.com; s=arc-20160816; b=mqDq1omWZpPUoamZ3pffUDPpgVHx2BGJDL4zyldkiTRTO9cBy6LU54uJrcHF6CMz9d 4o+6I+prsme35bRtQ1HhLMEtQnyrLgUiFEXk4df+PANW15jTr+L1uG9hXRe8MqFCmJP5 tlezsnXIVrIdtWiEc2Y5rmabmRL1K2YTEWTKtCfL85koa7Hy+41j0U1f3HQdY1iKqvaz JfTqEh/LhpjkwhyxrL4ByPWpni4fbcKGUP1o0tOP1KH48DlaS+JUdaGXy5cAnFZJyqwI PJEIcpyIYkiAwFS6Q0hnIQ4mT4nO0TFGbeVHE/nW4KfjqTCWs1thPT1S81EJTK7lPeVt CKTg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=ASJIFeVb4/jzzyTZ/kIiW0l+JRFXzYz6cYGbV8kdkbY=; b=GVmofcvG58U+V0/4rJAzyVMNvAtK6twDIAE5WiI+Odn/uL62QEXmcKFKZyG1irnOki v/eXufMRrPFhi02iPTgvJC9JSwzKi73iTKhMaQaaC8sd0+QtxVEcDnJ0DcVlEEN25Ujb AuCf/xYVtUuCeThMsHy5W6pJS50nMQGh7hp7mQDhwXsnSnL08i2WGZ1aeg9kLN31Tt5a 8RaaHXMoQC2vimjerPijrjDgm55l3Q8WQ63NQSefMzv9nbA3HPd9pCnYs2I6GScfftMA HzhRyNiwkwlFEJ5jmj1YfsZUoCXKipuKka2M9WlwVdZW8IoLuK/9wgNiKSpMftKFRCvF L3fA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2020-01-29 header.b=SRtxdB2H; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id 18si3226208edv.191.2020.07.23.11.24.26; Thu, 23 Jul 2020 11:24:49 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2020-01-29 header.b=SRtxdB2H; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726811AbgGWSYG (ORCPT + 99 others); Thu, 23 Jul 2020 14:24:06 -0400 Received: from userp2130.oracle.com ([156.151.31.86]:58418 "EHLO userp2130.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726304AbgGWSYG (ORCPT ); Thu, 23 Jul 2020 14:24:06 -0400 Received: from pps.filterd (userp2130.oracle.com [127.0.0.1]) by userp2130.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 06NIGb1l045079; Thu, 23 Jul 2020 18:23:56 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=subject : to : cc : references : from : message-id : date : mime-version : in-reply-to : content-type : content-transfer-encoding; s=corp-2020-01-29; bh=ASJIFeVb4/jzzyTZ/kIiW0l+JRFXzYz6cYGbV8kdkbY=; b=SRtxdB2HJDb5fxt2abqDOerQ07hw8EfNxsfknJp8KN5s4J9EOWHwnEBu38Mvaaz7Di9P luSXSFhJCpetitzFng81kp+wyNUlwgyHO0PhAex0rkzGYnfcN5RAiseNIUjrbf8Oh5QV Givwr7mznDDyIrErSsFdJ30M9UKXFfZEs6LUEjHdTwXnIHAHVmeqERVkez0tqexxZTlD buFEjr7Y0fDq4HwTVGDXxJUXpkmte8mXpr0QOxCdEu8bHcL2dfiDVRwguRzjsb8gHKn1 PdSEWSRtvaQlHKtiahDimjRDgG9RDNDny/vEtsbFz5maW0ScEmJbiUm1uAi1T1ajL8lN Mw== Received: from aserp3020.oracle.com (aserp3020.oracle.com [141.146.126.70]) by userp2130.oracle.com with ESMTP id 32brgru446-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 23 Jul 2020 18:23:56 +0000 Received: from pps.filterd (aserp3020.oracle.com [127.0.0.1]) by aserp3020.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 06NIIMJb190971; Thu, 23 Jul 2020 18:21:55 GMT Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by aserp3020.oracle.com with ESMTP id 32fc0b2up5-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 23 Jul 2020 18:21:55 +0000 Received: from abhmp0003.oracle.com (abhmp0003.oracle.com [141.146.116.9]) by aserv0121.oracle.com (8.14.4/8.13.8) with ESMTP id 06NILsC0025625; Thu, 23 Jul 2020 18:21:54 GMT Received: from [192.168.2.112] (/50.38.35.18) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Thu, 23 Jul 2020 11:21:54 -0700 Subject: Re: [PATCH v2 4/4] mm/hugetl.c: warn out if expected count of huge pages adjustment is not achieved To: Baoquan He , Anshuman Khandual Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, david@redhat.com, akpm@linux-foundation.org References: <20200723032248.24772-1-bhe@redhat.com> <20200723032248.24772-5-bhe@redhat.com> <62c8ce6c-fe98-f371-99b6-cfdb96d1c2fd@arm.com> <20200723091142.GR32539@MiWiFi-R3L-srv> From: Mike Kravetz Message-ID: Date: Thu, 23 Jul 2020 11:21:52 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.9.0 MIME-Version: 1.0 In-Reply-To: <20200723091142.GR32539@MiWiFi-R3L-srv> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9691 signatures=668680 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 adultscore=0 bulkscore=0 malwarescore=0 mlxscore=0 suspectscore=0 phishscore=0 spamscore=0 mlxlogscore=999 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2006250000 definitions=main-2007230133 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9691 signatures=668680 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 malwarescore=0 bulkscore=0 spamscore=0 impostorscore=0 suspectscore=0 adultscore=0 clxscore=1015 mlxlogscore=999 priorityscore=1501 phishscore=0 lowpriorityscore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2006250000 definitions=main-2007230133 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 7/23/20 2:11 AM, Baoquan He wrote: > On 07/23/20 at 11:46am, Anshuman Khandual wrote: >> >> >> On 07/23/2020 08:52 AM, Baoquan He wrote: >>> A customer complained that no message is logged wh en 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. >> >> But is kernel expected to warn for all such situations where the user >> requested resources could not be allocated completely ? Otherwise, it >> does not make sense to add an warning for just one such situation. > > It's not for just one such situation, we have already had one to warn > out in mm/hugetlb.c, please check hugetlb_hstate_alloc_pages(). Those are a little different in that they are warnings based on kernel command line parameters. > As Mike said, in one time of persistent huge page number setting, > comparing the old value with the new vlaue is good enough for customer > to get the information. However, if customer want to detect and analyze > previous setting failure, logging message will be helpful. So I think > logging the failure or partial success makes sense. I can understand the argument against adding a new warning for this. You could even argue that this condition has existed since the time hugetlb was added to the kernel which was long ago. And, nobody has complained enough to add a warning. I have even heard of a sysadmin practice of asking for a ridiculously large amount of hugetlb pages just so that the kernel will allocate as many as possible. They do not 'expect' to get the ridiculous amount they asked for. In such cases, this will be a new warning in their log. As mentioned in a previous e-mail, when one sets nr_hugepages by writing to the sysfs or proc file, one needs to read the file to determine if the number of requested pages were actually allocated. Anyone who does not do this is just asking for trouble. Yet, I imagine that it may happen. To be honest, I do not see this log message as something that would be helpful to end users. Rather, I could see this as being useful to support people. Support always asks for system logs and this could point out a possible issue with hugetlb usage. I do not feel strongly one way or another about adding the warning. Since it is fairly trivial and could help diagnose issues I am in favor of adding it. If people feel strongly that it should not be added, I am open to those arguments. -- Mike Kravetz