Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp971912ybv; Wed, 5 Feb 2020 18:17:13 -0800 (PST) X-Google-Smtp-Source: APXvYqxLsDVRwcySykM4p31PQz9Lg8g4fv7CwjxmM7+MOTT7DR5jjvIEkwGJ+CjHj6n6jI7H1Ok6 X-Received: by 2002:a05:6830:114f:: with SMTP id x15mr27706937otq.291.1580955433460; Wed, 05 Feb 2020 18:17:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1580955433; cv=none; d=google.com; s=arc-20160816; b=rynlM11FKAjbPizhQboag0fhhosiEkcjkO5eO7KTtWaGRCmPaQqzpAely+PM7+XCfg dLDjsVKiQRfmEiAVWEZemDYA/HSgPcWUHE7X35kb/7xAEkVwchFx8HHyuHnTbUrTwAOy 6q+EoWwZfho28qnyyaeST5KTFc1sxaNKOLYnCz8lgQ900eU4MeK5WpCj8xCIRXJLRupR NH1ecql6HXXLwNOxlSnNlQqQagb+l5tfyZDS3+q3yOOzpbgzxIETv6OPh4I4pbJRIkrb upinIBr5TccTzBQ39WR1hmLP9fozjUupSgQjpWvdSrvPPGWzReEtRhzg5BBUJRvZApTm nx6w== 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 :dkim-signature; bh=t+D4j4G5Deohl2w/m6COIz7G6YZYqDMg9nUp9Tlbhvo=; b=GK2spbQnoXTLHH4g2IcgUz4DP/gY5TU8YFtm1y3dASGRkwLmBVM4YDkW2zGzogRNoJ esK6g1aPxnZWlklEbOxNz1Jc1kv9WAUdE34zz6dCWVxah8IhUPhWtB99aQlhroX0QP66 WCfjfmH3HbhwNkwKcSzXX3dOIPTpU542JMPgoOXlEeBMFOSExbkApU81Hjnht1JZnzZp h6SQZ/wgU8m5QESaZxvEvdENxqPv22CXQ0s1P6V/mm+yttr14rGYhG6G0StXaPvjh9BS K6AzR4Z1VQNWX8xOr6+gKI2U1JKMxxGhzalftPzQZ3Xw3EArMSvFThbzEVbve0f80115 9YCw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2020-01-29 header.b=GLUbw063; dkim=pass header.i=@oracle.com header.s=corp-2019-08-05 header.b=QWViX+zU; 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 k11si1064444otp.176.2020.02.05.18.16.58; Wed, 05 Feb 2020 18:17:13 -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-2020-01-29 header.b=GLUbw063; dkim=pass header.i=@oracle.com header.s=corp-2019-08-05 header.b=QWViX+zU; 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 S1727599AbgBFCMh (ORCPT + 99 others); Wed, 5 Feb 2020 21:12:37 -0500 Received: from userp2120.oracle.com ([156.151.31.85]:51850 "EHLO userp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727170AbgBFCMh (ORCPT ); Wed, 5 Feb 2020 21:12:37 -0500 Received: from pps.filterd (userp2120.oracle.com [127.0.0.1]) by userp2120.oracle.com (8.16.0.27/8.16.0.27) with SMTP id 016298no128278; Thu, 6 Feb 2020 02:12:30 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=t+D4j4G5Deohl2w/m6COIz7G6YZYqDMg9nUp9Tlbhvo=; b=GLUbw063qNnTe9MNJSAoROwPcPqU6HAKh1orO+BWPpD6eIjsQVck6D7zqlONFOiaYyJE GGmjrQn6hiROcgd5AVy9/B9cAoXN1QxpDOq0zrNVZtT0KHFJFxGtQpyeg/HIqWWslr/e MGXl42mjqO45bJ1ZQpR7iJTbcAmW31wRzB0dBl4PW9RdE+ZtgNJC0kzANN14hTOVDk1k QFnNcCnsFt2x4P2TJNg8scJJ8HAtY8fI3REREadJbO/ZIMu6N75GbD308ygqNRVT+iKL lGBoxImEM33KnYFAOUkdVrKNA/pZtBKOaDglf68XgTKUoHkU736sxUSQs3V0HZcr3G4y uQ== 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-2019-08-05; bh=t+D4j4G5Deohl2w/m6COIz7G6YZYqDMg9nUp9Tlbhvo=; b=QWViX+zU3VnIerffikL7Bw22mgLz3+lBkq0VCDR/evI0ySEGyX0af/XeRFXR8OWiPjdf wn4zgpnfzygikGHBfLJxUH5HAXI/9ufXjNDqYjRt2lAglB4DMEZOwlfxL6LmSRNwOCuA qjSjGJt6yG0dcZyHotsOJTYrhni1aCECpSsTt4RFuBc2boNwfMDPaE1wOqU4hIvFliGd oQq4BXEvcRFsY1jwdHL8AOky7umgGkeqVkXsYc/VQ33BaIQJ+ZEPjMisc7IWfxocIOLj n2qWMOOIc00aZdDNLeppyXlixlsijIFHip49coLxOrB8TBZcC5Ui0av0y3vIaMuAAnI3 uA== Received: from userp3030.oracle.com (userp3030.oracle.com [156.151.31.80]) by userp2120.oracle.com with ESMTP id 2xykbpeu55-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 06 Feb 2020 02:12:30 +0000 Received: from pps.filterd (userp3030.oracle.com [127.0.0.1]) by userp3030.oracle.com (8.16.0.27/8.16.0.27) with SMTP id 01629208102400; Thu, 6 Feb 2020 02:12:29 GMT Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by userp3030.oracle.com with ESMTP id 2xymuu75gq-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 06 Feb 2020 02:12:29 +0000 Received: from abhmp0013.oracle.com (abhmp0013.oracle.com [141.146.116.19]) by aserv0122.oracle.com (8.14.4/8.14.4) with ESMTP id 0162CSpf016896; Thu, 6 Feb 2020 02:12:28 GMT Received: from [192.168.1.206] (/71.63.128.209) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Wed, 05 Feb 2020 18:12:27 -0800 Subject: Re: [PATCH v11 4/9] hugetlb: disable region_add file_region coalescing To: Mina Almasry Cc: shuah , David Rientjes , Shakeel Butt , Greg Thelen , Andrew Morton , open list , linux-mm@kvack.org, linux-kselftest@vger.kernel.org, cgroups@vger.kernel.org References: <20200203232248.104733-1-almasrymina@google.com> <20200203232248.104733-4-almasrymina@google.com> From: Mike Kravetz Message-ID: Date: Wed, 5 Feb 2020 18:12:26 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.4.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9522 signatures=668685 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1911140001 definitions=main-2002060013 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9522 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-1911140001 definitions=main-2002060013 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2/5/20 5:43 PM, Mina Almasry wrote: > On Wed, Feb 5, 2020 at 3:57 PM Mike Kravetz wrote: >> >> On 2/3/20 3:22 PM, Mina Almasry wrote: >>> A follow up patch in this series adds hugetlb cgroup uncharge info the >>> file_region entries in resv->regions. The cgroup uncharge info may >>> differ for different regions, so they can no longer be coalesced at >>> region_add time. So, disable region coalescing in region_add in this >>> patch. >>> >>> Behavior change: >>> >>> Say a resv_map exists like this [0->1], [2->3], and [5->6]. >>> >>> Then a region_chg/add call comes in region_chg/add(f=0, t=5). >>> >>> Old code would generate resv->regions: [0->5], [5->6]. >>> New code would generate resv->regions: [0->1], [1->2], [2->3], [3->5], >>> [5->6]. >>> >>> Special care needs to be taken to handle the resv->adds_in_progress >>> variable correctly. In the past, only 1 region would be added for every >>> region_chg and region_add call. But now, each call may add multiple >>> regions, so we can no longer increment adds_in_progress by 1 in region_chg, >>> or decrement adds_in_progress by 1 after region_add or region_abort. Instead, >>> region_chg calls add_reservation_in_range() to count the number of regions >>> needed and allocates those, and that info is passed to region_add and >>> region_abort to decrement adds_in_progress correctly. >>> >>> We've also modified the assumption that region_add after region_chg >>> never fails. region_chg now pre-allocates at least 1 region for >>> region_add. If region_add needs more regions than region_chg has >>> allocated for it, then it may fail. >>> >>> Signed-off-by: Mina Almasry >>> Reviewed-by: Mike Kravetz >> >> This is the same as the previous version. My late comment was that we >> need to rethink the disabling of region coalescing. This is especially >> important for private mappings where there will be one region for huge >> page. I know that you are working on this issue. Please remove my >> Reviewed-by: when sending out the next version. >> > > Yes to address that there is a new patch in the series, which > re-enables the coalescing when the hugetlb cgroup uncharge info is the > same. I guess it could be squashed with this one but I thought it was > better to implement that patch on top of the patch that enabled shared > accounting, because that is the patch that sets hugetlb cgroup info on > the file region entries. > > Let me know what you think. Thanks, I saw there was an additional patch but I did not get to it yet. I'll take a look and see how involved the changes are. -- Mike Kravetz