Received: by 2002:ac0:aed5:0:0:0:0:0 with SMTP id t21csp4537902imb; Wed, 6 Mar 2019 16:19:03 -0800 (PST) X-Google-Smtp-Source: APXvYqxT5zNRfYQ3R9lOZRZ3mRpyKhxcQWfOVUzAiiIV5JcRerePgPJIJp+JTjo4qk7qzOeT8WCe X-Received: by 2002:a62:6046:: with SMTP id u67mr10033908pfb.46.1551917943099; Wed, 06 Mar 2019 16:19:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1551917943; cv=none; d=google.com; s=arc-20160816; b=iVugyfy/i4vlI56m0uZHxBm/xDKX6lr9rMPs+6Q40rR2Fz5DqlGdUmdu+b2M0AUhNs xPghAQYLNY0eKla2GQavNKr25eUIpRsWmDbWKqft3BSv6QCLi641hwmRzSRVhmouEjiG Gxe74zP3rqIArGEXXpDphCSub0aQrzagTIVWuR8CmG5b3cQA9TQJxu3JAWGXU9FDFNnH +TxZYvJNoh3ZUNGBRKXgETQ7xFvV+VLcGZWx6ntddvJP6FWoHmG2IaLZUY9Q+mNXjrUO lINNm1rOqaQx0zRXjyZWQ9qE3uZvWHMNnnbSbqghap/ftAJZtZV2WywysUygQkjbF87S sfsQ== 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=1SSZKMewF3WkzE1mzuK0CNh8oEr66tJRi9S895bMdCU=; b=Qd40/OrdxbhkYcwfqJPNgEzPRp2cbiSCgrVFMPcs/pSCJrBIN1uLPy8FTjYbf8MmXZ zGMHiHIWkoB/aWz9FZ3WfDGBt/GsnhTjlavClYnayelfNC8aGaFRjmAizdSYZoxLxXjw i09olWrHzLjZrE2npyCXDyItR+eAL9GDDs3svKcycDRSPPT13cj8l9YLAxQx/xq8nVtg N6S5hAfftEDyXpeCnz3YIEkZKR0yD3Z4E9n0dDNl/6X1c8SY//A+dRnlIUIE9oI48ws3 kInAvGtZphs12PCJKGKrT0CbPWxyjcOtfGgbqWCuN0Dque2bGrcCLWomtPfoekzxLBK5 RmRA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2018-07-02 header.b=jHiVPwWd; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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. [209.132.180.67]) by mx.google.com with ESMTP id w185si2540581pgd.495.2019.03.06.16.18.47; Wed, 06 Mar 2019 16:19:03 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2018-07-02 header.b=jHiVPwWd; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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 S1726207AbfCGASB (ORCPT + 99 others); Wed, 6 Mar 2019 19:18:01 -0500 Received: from userp2130.oracle.com ([156.151.31.86]:48794 "EHLO userp2130.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726028AbfCGASA (ORCPT ); Wed, 6 Mar 2019 19:18:00 -0500 Received: from pps.filterd (userp2130.oracle.com [127.0.0.1]) by userp2130.oracle.com (8.16.0.27/8.16.0.27) with SMTP id x2704Z8n124182; Thu, 7 Mar 2019 00:17:40 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-2018-07-02; bh=1SSZKMewF3WkzE1mzuK0CNh8oEr66tJRi9S895bMdCU=; b=jHiVPwWd3BlJYp8fneR7mB+nGICQf8Gt+VHVCBAsjGYPW2f8giLaYJgCve0Iai3Id0On EUGrVJOcF0WvOaSF2KkAC7hqwLlE67FcXBxR3ysYCzQTHI/jfBmH7xy5xiG1VaQaiBWr raSoliwOmnDSfjEZpIA7/OXYjT3yxjYg9uHCgEuS6RZo6vO/bk0B2wKGARi0foHZ8oCC eMygVw3J2JG0tNPZX+egVEWdDHnVxdPkFOTRR5VDhPvGm/abbMkvGOlbP5RA/9y09xWn Bbm7GqYw63XxPpQbi6iKFK5uqgzSNjSJKPwuhSKj4lG1PdS10ZGQ0tmy78D2I3Z4q04D Vg== Received: from userv0022.oracle.com (userv0022.oracle.com [156.151.31.74]) by userp2130.oracle.com with ESMTP id 2qyh8uf375-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 07 Mar 2019 00:17:40 +0000 Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by userv0022.oracle.com (8.14.4/8.14.4) with ESMTP id x270HdpG019570 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 7 Mar 2019 00:17:39 GMT Received: from abhmp0009.oracle.com (abhmp0009.oracle.com [141.146.116.15]) by userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id x270HaEn008410; Thu, 7 Mar 2019 00:17:37 GMT Received: from [192.168.1.164] (/50.38.38.67) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Wed, 06 Mar 2019 16:17:36 -0800 Subject: Re: [PATCH v4] mm/hugetlb: Fix unsigned overflow in __nr_hugepages_store_common() To: Oscar Salvador Cc: Naoya Horiguchi , Andrew Morton , David Rientjes , Jing Xiangfeng , "mhocko@kernel.org" , "hughd@google.com" , "linux-mm@kvack.org" , Andrea Arcangeli , "kirill.shutemov@linux.intel.com" , linux-kernel@vger.kernel.org, Alexandre Ghiti References: <8c167be7-06fa-a8c0-8ee7-0bfad41eaba2@oracle.com> <13400ee2-3d3b-e5d6-2d78-a770820417de@oracle.com> <5C74A2DA.1030304@huawei.com> <20190226143620.c6af15c7c897d3362b191e36@linux-foundation.org> <086c4a4b-a37d-f144-00c0-d9a4062cc5fe@oracle.com> <20190305000402.GA4698@hori.linux.bs1.fc.nec.co.jp> <8f3aede3-c07e-ac15-1577-7667e5b70d2f@oracle.com> <20190306094130.q5v7qfgbekatnmyk@d104.suse.de> From: Mike Kravetz Message-ID: Date: Wed, 6 Mar 2019 16:17:35 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.4.0 MIME-Version: 1.0 In-Reply-To: <20190306094130.q5v7qfgbekatnmyk@d104.suse.de> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=9187 signatures=668685 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1903060164 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 3/6/19 1:41 AM, Oscar Salvador wrote: > On Mon, Mar 04, 2019 at 08:15:40PM -0800, Mike Kravetz wrote: >> In addition, the code in __nr_hugepages_store_common() which tries to >> handle the case of not being able to allocate a node mask would likely >> result in incorrect behavior. Luckily, it is very unlikely we will >> ever take this path. If we do, simply return ENOMEM. > > Hi Mike, > > I still thnk that we could just get rid of the NODEMASK_ALLOC machinery > here, it adds a needlessly complexity IMHO. > Note that before "(5df66d306ec9: mm: fix comment for NODEMASK_ALLOC)", > the comment about the size was wrong, showing a much bigger size that it > actually was, and I would not be surprised if people started to add > NODEMASK_ALLOC here and there because of that. > > Actually, there was a little talk about removing NODEMASK_ALLOC altogether, > but some further checks must be done before. Thanks for the information. I too saw or remembered a large byte value. :( A quick grep doesn't reveal any configurable way to get NODE_SHIFT larger than 10. Of course, that could change. So, it does seem a bit funny that NODEMASK_ALLOC() kicks into dynamic allocation mode with NODE_SHIFT > 8. Although, my desktop distro has NODE_SHIFT set to 10. >> Reported-by: Jing Xiangfeng >> Signed-off-by: Mike Kravetz > > But the overall change looks good to me: > > Reviewed-by: Oscar Salvador Thanks. I'm going to leave as is for now and put off removal of the dynamic allocation for a later time. Unless, you get around to removing NODEMASK_ALLOC altogether. :) -- Mike Kravetz