Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp6112165ybv; Tue, 18 Feb 2020 10:07:55 -0800 (PST) X-Google-Smtp-Source: APXvYqwPbP29XKEx2FLuED4hzzQ3RCR6H5LG/Ax4/lydVzkqmisD9e7O1IHug76frafGUVBGynXq X-Received: by 2002:a05:6830:128e:: with SMTP id z14mr11573958otp.184.1582049275067; Tue, 18 Feb 2020 10:07:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582049275; cv=none; d=google.com; s=arc-20160816; b=Mv5vN4UCEA0vninhlonq5IeqUcV4TOd6GybgMlFzhyjBazGnYXRtYa+3oreVyeoyZz OZMl8USojaDOaH/n2bS61CfO67pQWScWEsuT+Kk2ux0bz17tJF6nMIctUZZ+bagNK+PT aIl9WMSgcYeY2GVsD83aKjEd015MoHrMyeBWXwJSsFcb+Twgd8CsZw1aaxeq4DvQBZfJ rq8yfp0NbYIpadgpHW/0vtfqhgyGz8LgaBBOIAmqMNvhceunX257MB2Ii8wK58zB5ONV yWEvnumXQPDmppujB/s/tURlc78OK4VdCLmMKDmsOs4rJ1X1LRlsdlnWmHNIiuUiVLBv rV0g== 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=e3JY76Nw6Z8qX70Yw+VTwQiabRUZeD/vVIWatfgrW04=; b=0i3Ge0QpPlwbyYdpPAxtiNUjcUtMzBDAj/H4dRXFSl4KijOYTVEJtYSzZtWwPi2cQs x4s7Z3irJNtTNNtIgjknygHrlK0nCvTjk5AUA8oiie45QabFAhmuCE/sxMXKihM+Xynd R+TXuAlFkp4Lf7jMirXTDi566FKqpgcU5/lzGk1ePnmmLIxWYk70ddeQRTGkbGmOCKRq /mBK02gSs3CVh1NGe/eXgt9xR8K5oLSyojirvvbdca6tNCVZnuw3T2RvYDkoKV1ARl/1 e9m5CHi4rHV9ywEncbTRDc6QCzKtRLPxlBwf/yqe28hZXvljdXfpXabEMyqkUE3cV25K upOw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2020-01-29 header.b=IM0UnXqN; 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 j65si1983954otc.308.2020.02.18.10.07.41; Tue, 18 Feb 2020 10:07:55 -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=IM0UnXqN; 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 S1726508AbgBRSHa (ORCPT + 99 others); Tue, 18 Feb 2020 13:07:30 -0500 Received: from userp2130.oracle.com ([156.151.31.86]:38398 "EHLO userp2130.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726168AbgBRSHa (ORCPT ); Tue, 18 Feb 2020 13:07:30 -0500 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 01II0qDX046730; Tue, 18 Feb 2020 18:07:24 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=e3JY76Nw6Z8qX70Yw+VTwQiabRUZeD/vVIWatfgrW04=; b=IM0UnXqNMAWDp5h99bss7p2XZ7UfyP25Jwa03tDvRTM57+ywGz+cVbLLpCHfSFgJYP3L 159R+3QwknVgwkxQ/q79T1rSf8YP/kABkV+A/zoGQeCdtwtHl+prT03PtTmG/QIk2MUB yIHNBHNa7FFPHxWL86DJUzFkdrnGapH0nBYRiMC6lhP1fRgjIDOh5qIEM/b5TErcsIbt W+UDZy2S3E1uJQJG9rffCMKlFMyEcNt0rze5VUSFJ0YB8XRsa0Cx6AxlfzerHgK00mAa 1yEaTrlz+VcdDWP7Pk5ixR+9utbhuNOCpiv7Rt2qz4affGYre6vrpO7USqriFDtJ1LHE NQ== Received: from aserp3030.oracle.com (aserp3030.oracle.com [141.146.126.71]) by userp2130.oracle.com with ESMTP id 2y7aq5u4nv-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 18 Feb 2020 18:07:23 +0000 Received: from pps.filterd (aserp3030.oracle.com [127.0.0.1]) by aserp3030.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 01IHwFk9063735; Tue, 18 Feb 2020 18:07:23 GMT Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by aserp3030.oracle.com with ESMTP id 2y82c1vxf0-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 18 Feb 2020 18:07:23 +0000 Received: from abhmp0008.oracle.com (abhmp0008.oracle.com [141.146.116.14]) by userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id 01II7LLD021385; Tue, 18 Feb 2020 18:07:21 GMT Received: from [192.168.1.206] (/71.63.128.209) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 18 Feb 2020 10:07:21 -0800 Subject: Re: [PATCH v12 5/9] hugetlb_cgroup: add accounting for shared mappings To: Mina Almasry Cc: shuah@kernel.org, rientjes@google.com, shakeelb@google.com, gthelen@google.com, akpm@linux-foundation.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-kselftest@vger.kernel.org, cgroups@vger.kernel.org References: <20200211213128.73302-1-almasrymina@google.com> <20200211213128.73302-5-almasrymina@google.com> From: Mike Kravetz Message-ID: <40f86207-6f4d-1d00-b6ac-b837c20626ea@oracle.com> Date: Tue, 18 Feb 2020 10:07:19 -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: <20200211213128.73302-5-almasrymina@google.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9535 signatures=668685 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 malwarescore=0 adultscore=0 phishscore=0 spamscore=0 suspectscore=0 mlxscore=0 mlxlogscore=999 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2001150001 definitions=main-2002180125 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9535 signatures=668685 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxscore=0 impostorscore=0 adultscore=0 spamscore=0 priorityscore=1501 suspectscore=0 clxscore=1015 bulkscore=0 phishscore=0 mlxlogscore=999 lowpriorityscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2001150001 definitions=main-2002180125 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2/11/20 1:31 PM, Mina Almasry wrote: > For shared mappings, the pointer to the hugetlb_cgroup to uncharge lives > in the resv_map entries, in file_region->reservation_counter. > > After a call to region_chg, we charge the approprate hugetlb_cgroup, and if > successful, we pass on the hugetlb_cgroup info to a follow up region_add call. > When a file_region entry is added to the resv_map via region_add, we put the > pointer to that cgroup in file_region->reservation_counter. If charging doesn't > succeed, we report the error to the caller, so that the kernel fails the > reservation. > > On region_del, which is when the hugetlb memory is unreserved, we also uncharge > the file_region->reservation_counter. > > Signed-off-by: Mina Almasry With addition of the build fix, Reviewed-by: Mike Kravetz -- Mike Kravetz