Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp3320222ybv; Sat, 15 Feb 2020 17:25:32 -0800 (PST) X-Google-Smtp-Source: APXvYqy9IUR/MyiUcvcpls1pZb+rfjPyD+YSfAExor39/xC9eSvFzN6e46m+lhpC/YQrekS+7/bs X-Received: by 2002:a54:410e:: with SMTP id l14mr6157650oic.42.1581816332099; Sat, 15 Feb 2020 17:25:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581816332; cv=none; d=google.com; s=arc-20160816; b=0L4nhi5O4F17M9TUkx/eeRgPvty3W9yuIwmGGHTmE9q7/sgzKAl7MdtI9EnPaQzHDJ taj8E5gc/YLSomtcDJpwevaUZ2dzS175EZc/NNprEBV1vtXx1cWraqqkk3ZOjPhE0XqO eTWCDYKyIKC98lZGEGELgMfZGt4gpm6LRuXKCRKrZ1fBoxJ5O/4am966mfzkLPjMpbOf MDLQGeph7NKY32sr+4hJRUT7yOCTZUuU8eb6sqYxY9TTfwTc6s4Op0jcj7vSBz6eraNb yy0aDDq7uP9IE7ZP0Aopin8sirZ2q3OoSgJZbyaG0eNL3f+jxI/mdt5/EfjEsqeqKyCO PfxA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :message-id:in-reply-to:subject:cc:to:from:date:dkim-signature; bh=LqZnlLjYXByu2d6oczewxnnow4SoLrPRaLAQ85cZs38=; b=rShSE2YwS8Mmn5NheAN1guXCFgXBynBM8uyKIYqF50Ncvqrr1KDkcgUwdslNgDKZoj fPz4SbB9D1Q8esy461xBdPsPmt5MUVuWMqThAsYo0Pk1AnQh8OO1ZB6NukMzAvKcsN9l AlGYcpXWKCNncNn/ff5t0XThOjLfp//1DZFonij7nt51My+DPsJ/x3XETlJDPTf1IuHv 0MJ5o0CY8peFKSxagNgP2f6oDGgAArcAmZ91RGBl8LipbL5N0XVIuFbYg5lZa4p00Qjb tJq6PBAeUvAMNi+Bm9n+jQX29QJMv2OEu2fEhAQEWP+NYGLFN1IDQa/VWSvyPM7T29eW cgVg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=ek3rwVmX; 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 v7si4833760oic.208.2020.02.15.17.25.19; Sat, 15 Feb 2020 17:25:32 -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=@google.com header.s=20161025 header.b=ek3rwVmX; 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 S1726676AbgBPBZP (ORCPT + 99 others); Sat, 15 Feb 2020 20:25:15 -0500 Received: from mail-pl1-f193.google.com ([209.85.214.193]:40132 "EHLO mail-pl1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726608AbgBPBZP (ORCPT ); Sat, 15 Feb 2020 20:25:15 -0500 Received: by mail-pl1-f193.google.com with SMTP id y1so5306898plp.7 for ; Sat, 15 Feb 2020 17:25:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:from:to:cc:subject:in-reply-to:message-id:references :user-agent:mime-version; bh=LqZnlLjYXByu2d6oczewxnnow4SoLrPRaLAQ85cZs38=; b=ek3rwVmXj8vmK4TuGeFA7GZoFc3SKRxyUg3Z2Utr4BYFXjER4M9c9s+39gzUc1NB8k 1b6/SZzqs107NzNUoJBcA7iGGny1ry6WtZq+L+AB2PnJF8Lj/mKZF1JohFm0Y8aXW0OA wGfh1TZZ7MhOkF0cUh3XiBJA3MVKURpjnx1PzlxYCQkwMjCpJ5uvfuAyo4SU66KnkpBt r/XyJSTlFKfkLQwKcGZK292JszBSePd4FDonFuwuFE5W0QaeYrlbO5JGjsCaU5bWTVvY DTutPkpEy0ocnVJL21xAK+pOpW1lYUfWii6GP7GLgkKleg4WTF2siEg2yODyj9tNkCO0 k7NQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:in-reply-to:message-id :references:user-agent:mime-version; bh=LqZnlLjYXByu2d6oczewxnnow4SoLrPRaLAQ85cZs38=; b=MHUeqvYLJ4FNz3K+kZhxfKAYSIpBk2IzslMVFcVHazR+LCKTJ4LTcXMF2S3rRgczXz vukUU4oVeldfsUHBSdmgWKlM1rwf6zURtPceUL99oSNTwUBZ9V/vmegGwdJNmqvyd559 dhnwOCkSqRHiKSMiEmTC98kcpdoVcTyFVuD3T3DJhGudzDTgxB2Hrypoo+ofUG1rul3a tB4iOBx9lN7YSPv4jdMzxI7iZiieiE/i4F6hlkzFMcyKYhMSSsTqeSAlA6G3Ugg8YfBU +/5Y4fPfLBjAZLsJd8GwJzxVB84hYwF5DyGZ6D8Axdb9v1wa3lpBOqcaW2DyYD2Q5bIP OtUA== X-Gm-Message-State: APjAAAVt0Pf57GE6ffN5wM+2ArlWYr/qWKmJL+QnLjSLDMYAku1gywuM KhygfymvWNnSzjtnzFOKoMssx+kfVUs= X-Received: by 2002:a17:90a:f012:: with SMTP id bt18mr12302718pjb.8.1581816314194; Sat, 15 Feb 2020 17:25:14 -0800 (PST) Received: from [2620:15c:17:3:3a5:23a7:5e32:4598] ([2620:15c:17:3:3a5:23a7:5e32:4598]) by smtp.gmail.com with ESMTPSA id r8sm11390168pjo.22.2020.02.15.17.25.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 15 Feb 2020 17:25:13 -0800 (PST) Date: Sat, 15 Feb 2020 17:25:13 -0800 (PST) From: David Rientjes X-X-Sender: rientjes@chino.kir.corp.google.com To: Mina Almasry cc: mike.kravetz@oracle.com, shuah@kernel.org, shakeelb@google.com, gthelen@google.com, Andrew Morton , linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-kselftest@vger.kernel.org, cgroups@vger.kernel.org Subject: Re: [PATCH v12 4/9] hugetlb: disable region_add file_region coalescing In-Reply-To: <20200211213128.73302-4-almasrymina@google.com> Message-ID: References: <20200211213128.73302-1-almasrymina@google.com> <20200211213128.73302-4-almasrymina@google.com> User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 11 Feb 2020, 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 Acked-by: David Rientjes