Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp5128366ybp; Mon, 14 Oct 2019 16:03:08 -0700 (PDT) X-Google-Smtp-Source: APXvYqz5/7PIlBPS+dTiiW57lEEK4oXgsTy7qgjjtMy0rZaE/XyVY5hWQ9Dl0z52x6VUdqUavkxj X-Received: by 2002:a17:906:f110:: with SMTP id gv16mr31666649ejb.331.1571094188272; Mon, 14 Oct 2019 16:03:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571094188; cv=none; d=google.com; s=arc-20160816; b=b0dB4+gaPr89rTzn2qPY8fCO+qKUudj/hRSfMpJin2i1GUfFyHVHCX9XruZWFGw6vd mn1fE5fFv9+sUSJWNCcAOW0bjBSXQNzWnww4pNiDsV0rE3WsllANcAKIIGovDzN7HyKi vS5glRDeSbgEy9FS5DIBDNzIaHFi69EB/9MLibHj/EGCTWQ58QYhRkpxp4sPB69nvXtd iXO3oSUEF8XJ4G/msR3qxQFhgq1ulC6NTr9t5aCtCNCWFBmJyPUW+G2u87cYrn+of3C7 mFLYzprasymXxKJm/gfoeC83iEv4fL8YbG05WKAGgvCfSLd9o7xTgJ92bM5inRr2pQnv VQLw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=xyCSAk4ZobdR/xeJ0/E5vnN7i5VLU1sZ6lMD0865OQ8=; b=zUyWpBy3uSngxYpF6FD2Qm3cJdqwvYzmD5gq6ESKwWlJAG1f0Hjx3umCa/mcAA0Qnv 77aTMlCjTHLNmL9KQhfFeXuvGeE4fKUQdx8c4mW4XNhS1A+NHhRU5R3gIjw+e+C6EyQf 3WpwEVGlorCL6g/Uik1msVRO81WLHPbSwV+qon+ZtGjJZqwEfntei1OTHWnCb/Bc91Fe f0exAdse6Lrom5IhZ59+c7FhIern2SWjADpxPm0xmvCZJniSgpwH5YIsQWApzSH1HvvI PrExk8BbllEZRqnGGyvH4Mx6c3ZkpAb/XrULRX1SX5mWHZixS1h9LNlaihXXDbUfKwQb wOow== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b="I1x1Z8t/"; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e1si12838409ede.268.2019.10.14.16.02.22; Mon, 14 Oct 2019 16:03:08 -0700 (PDT) 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=@google.com header.s=20161025 header.b="I1x1Z8t/"; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731529AbfJNSBk (ORCPT + 99 others); Mon, 14 Oct 2019 14:01:40 -0400 Received: from mail-ot1-f65.google.com ([209.85.210.65]:33086 "EHLO mail-ot1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726589AbfJNSBk (ORCPT ); Mon, 14 Oct 2019 14:01:40 -0400 Received: by mail-ot1-f65.google.com with SMTP id 60so14568607otu.0 for ; Mon, 14 Oct 2019 11:01:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=xyCSAk4ZobdR/xeJ0/E5vnN7i5VLU1sZ6lMD0865OQ8=; b=I1x1Z8t/J1yynjUcQTaYcMAGlN47njD35U9306oaZGwet7E/ZBWTyw79fMty3Sa/RK jNwz8QvsXEa/3cyF5QkHhhHLve/QinyFaA7Agy9aj1p+AnR+z3j8k6lrs03DUL228MFg l8iUcJTUJpDvM//PJdKIhYQodgVX5aUDpuo940IIeoCN64AO9s5qtLgop0i1e3e7Fyul v4NeG2eK6T1TFr3P9I8Pgf8GUBhq3m9BYkcppXzd4WbWMSo17r2krD+y2MbewOxpBPnG 62TsJgRjY2rTFg93oghC2gS0WVUXZaNMWTxA7mikuTmITqWLzKgrZSohb1WMiZZ5qzmJ QR6A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=xyCSAk4ZobdR/xeJ0/E5vnN7i5VLU1sZ6lMD0865OQ8=; b=QdPgBPUFQ5juA2lWdXAbDh/2tOSgvUScmFcRu32ty4tYjBInEI6PNalUTAT+sRqsKN ExV+mHhXoYaHkoqbx1Az3eBcR2mpbk2HV6Vq2Ar8845PTU2HcCEhrP74QJ4qjNI8hfJu w54KXVhbSBBx61jKeRk9P0WIdK/Gtbh0R61ZIHk+5kY5noxMN6u2nWsaAN8IQE8NhN3c 6s0+UlAZvzj0AxW9TRu5d+CLEVeBg1ZQStKqBnxycO2e0oHtkvSfzc62u32B5gZWQcjv t8Ix/sq2Lul7Ekej3/oQz5/qINcBPQIVreUd0J1g+mTEgyqA3wQKlUppaNRB7UH4iCSS Mxhg== X-Gm-Message-State: APjAAAUcL/GTj2ycCdFtAa+oQNo9VtAJMYB+QlG/aNgXyJZn+PIQrx4x DOwM/O3ljVmlTpg1e9kkbKPqNp9VPeG8YptFEMi/Tg== X-Received: by 2002:a9d:6e92:: with SMTP id a18mr24524365otr.313.1571076097842; Mon, 14 Oct 2019 11:01:37 -0700 (PDT) MIME-Version: 1.0 References: <20190919222421.27408-1-almasrymina@google.com> <3c73d2b7-f8d0-16bf-b0f0-86673c3e9ce3@oracle.com> In-Reply-To: From: Mina Almasry Date: Mon, 14 Oct 2019 11:01:26 -0700 Message-ID: Subject: Re: [PATCH v5 0/7] hugetlb_cgroup: Add hugetlb_cgroup reservation limits To: Mike Kravetz Cc: Aneesh Kumar , shuah , David Rientjes , Shakeel Butt , Greg Thelen , Andrew Morton , khalid.aziz@oracle.com, open list , linux-mm@kvack.org, linux-kselftest@vger.kernel.org, cgroups@vger.kernel.org, =?UTF-8?Q?Michal_Koutn=C3=BD?= Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Oct 14, 2019 at 10:33 AM Mike Kravetz wrote: > > On 10/11/19 1:41 PM, Mina Almasry wrote: > > On Fri, Oct 11, 2019 at 12:10 PM Mina Almasry wrote: > >> > >> On Mon, Sep 23, 2019 at 10:47 AM Mike Kravetz wrote: > >>> > >>> On 9/19/19 3:24 PM, Mina Almasry wrote: > >> > >> Mike, note your suggestion above to check if the page hugetlb_cgroup > >> is null doesn't work if we want to keep the current counter working > >> the same: the page will always have a hugetlb_cgroup that points that > >> contains the old counter. Any ideas how to apply this new counter > >> behavior to a private NORESERVE mappings? Is there maybe a flag I can > >> set on the pages at allocation time that I can read on free time to > >> know whether to uncharge the hugetlb_cgroup or not? > > > > Reading the code and asking around a bit, it seems the pointer to the > > hugetlb_cgroup is in page[2].private. Is it reasonable to use > > page[3].private to store the hugetlb_cgroup to uncharge for the new > > counter and increment HUGETLB_CGROUP_MIN_ORDER to 3? I think that > > would solve my problem. When allocating a private NORESERVE page, set > > page[3].private to the hugetlb_cgroup to uncharge, then on > > free_huge_page, check page[3].private, if it is non-NULL, uncharge the > > new counter on it. > > Sorry for not responding sooner. This approach should work, and it looks like > you have a v6 of the series. I'll take a look. > Great! Thanks! That's the approach I went with in v6. > -- > Mike Kravetz