Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp3442613pxb; Mon, 30 Aug 2021 02:14:01 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx5k4FpK518NA8Yw/O/0sEVRgLNNUK3hyjPIOdtaFR+jV6SMjI5jzKqsF9GzM0Ftk+Fr8JU X-Received: by 2002:a17:906:a24c:: with SMTP id bi12mr24452583ejb.530.1630314841504; Mon, 30 Aug 2021 02:14:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1630314841; cv=none; d=google.com; s=arc-20160816; b=vovn+7okcXB9h/fuGaw6cxm9afBMofDWX6fcx0sXVT1e6T18lw7wVj70li/waZ+bwV xKUZmLGvvZR8TDS42a+Y0fE0PmQmUncVUZuFdvOir0l7C+yQIWFUQA7zIoismRRxRLhn ejVfhdOXUVX4lyaQoz52N2qnoZc24yPJpeLgMZbgOK+inTI7eE8rWnUPzHD3hGM2qVrM C8CQuUIsI6Xa+MfZrHKj+7tZnCt3ivYuveg5Yu5OjaJFMg7RDCsO18XKVPD9fOjEKt8M cWcfwGkEPQX9aCXkDVePhNztOQTvPsMIn2djv1kBzcvxkb4s0jJ2o4eCh8SdmDFRSfYn eqFg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=u9PHrKLeF/G92NZinwTPYi6Jk6TfyNGd5chLk0Q8RQw=; b=FJIQaz8s+vu4Rs4Tz9JQ1mPFNFlIuPiR+qH1yJydj56Z1PmbPdkL6/v8mADDRYX9ET hGJmw3D0jqXQtCNJ/PPQ3fQOnSb87vnO5JrIwmL5Zbx9BwQDo8j5pyXHvYrn/aToLrg+ qygH/UYfLq4zSnJgzD1EC/5HwLhL0lMK0ZLENsZgSFMNumzY4S6SKizZY/lLy05/DRHF vpRA6ZGyquFWnZT08Y5HJUF+wX4vtYipTNTE3WjR1e/97hxU2T17INE2o0mNX8kRhkH8 VXILp3R1UUywdvnBoOPx1mTT6viOU62WJohkMSZVM/R5TUMgXy12/ekKUgWpSJf8uZoM AmFg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=K+blWjJc; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=suse.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i12si12916011edu.543.2021.08.30.02.13.38; Mon, 30 Aug 2021 02:14:01 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=K+blWjJc; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=suse.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235304AbhH3JMB (ORCPT + 99 others); Mon, 30 Aug 2021 05:12:01 -0400 Received: from smtp-out1.suse.de ([195.135.220.28]:47856 "EHLO smtp-out1.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234714AbhH3JMA (ORCPT ); Mon, 30 Aug 2021 05:12:00 -0400 Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out1.suse.de (Postfix) with ESMTP id AD9342210A; Mon, 30 Aug 2021 09:11:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1630314666; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=u9PHrKLeF/G92NZinwTPYi6Jk6TfyNGd5chLk0Q8RQw=; b=K+blWjJcwt1t6ZUxLw4mt6iY/X3AYSEpp+NgugaOuXgmjzDCUYli0wwrMc5ibDdmGsskje q7ovXoWsoNBgUQERrN98XxrPqK+VyMYtgLw5X07pYm6oM1djM8NFrRDMWmpXoLsO/vhY1J lg/OQ4n38Mu2nTZd0iXndKwD7cBPvNk= Received: from suse.com (unknown [10.163.43.106]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by relay2.suse.de (Postfix) with ESMTPS id 60D45A3B9D; Mon, 30 Aug 2021 09:11:06 +0000 (UTC) Date: Mon, 30 Aug 2021 10:11:04 +0100 From: Mel Gorman To: NeilBrown Cc: Chuck Lever III , Mike Javorski , Linux NFS Mailing List , linux-mm@kvack.org Subject: Re: [PATCH] MM: clarify effort used in alloc_pages_bulk_*() Message-ID: <20210830091104.GA3997@suse.com> References: <163004202961.7591.12633163545286005205@noble.neil.brown.name> <163004848514.7591.2757618782251492498@noble.neil.brown.name> <6CC9C852-CEE3-4657-86AD-9D5759E2BE1C@oracle.com> <416268C9-BEAC-483C-9392-8139340BC849@oracle.com> <12B831AA-4A4E-4102-ADA3-97B6FA0B119E@oracle.com> <163027609524.7591.4987241695872857175@noble.neil.brown.name> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline In-Reply-To: <163027609524.7591.4987241695872857175@noble.neil.brown.name> User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org On Mon, Aug 30, 2021 at 08:28:15AM +1000, NeilBrown wrote: > > The alloc_pages_bulk_*() interfaces do not make it clear what degree > of success can be expected. > > The code appears to allocate at least one page with the same effort as > alloc_page() when used with the same GFP flags, and then to allocate any > more only opportunistically. So a caller should not *expect* to get a > full allocation, but should not be *surprised* by one either. > > Add text to the comment clarifying this. > > Also fix a bug. When alloc_pages_bulk_array() is called on an array > that is partially allocated, the level of effort to get a single page is > less than when the array was completely unallocated. This behaviour is > inconsistent, but now fixed. > > Fixes: 0f87d9d30f21 ("mm/page_alloc: add an array-based interface to the bulk page allocator") > Signed-off-by: NeilBrown Acked-by: Mel Gorman -- Mel Gorman SUSE Labs