Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp2151795ybk; Mon, 11 May 2020 13:14:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxDmhwKZi5mxslTX6JGwfpKw4Kg75yuPSj1GGuZDRviawfaljIV0FgmCXpYWutoWeIwWXq0 X-Received: by 2002:aa7:c80f:: with SMTP id a15mr2719469edt.246.1589228055033; Mon, 11 May 2020 13:14:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589228055; cv=none; d=google.com; s=arc-20160816; b=zQ9bLQCoBbJ1B+Z6YunUdrLsoi88lcKIsHAmpeIIJ/2LMiptZc79r+YRQalAu5uay4 Up/jlAywLIZUmaNLseZUr+NZRGdV+BOuvdVlPtgnTbjxaew3HYCOXgsDZNd4ESlTgXoj Idjj5p3fz3FHeo4jJWRU0enbWNAB6SuAacdSmW6R2K5NsgvXzVvwbD2CIunTQlKcYS4g g5VjLYgUYYlv8fwuyYJ2lhKcjOSBQ/t60Grf3zM1LnwTSKttolzvI/kE47fUP31U7Lbf UKo/chIuZovtS3ez+efrlgjN4kDJBR75ddPKJ0Qf1ikWWOmyw6JYdAdn6y4ztbIhINtW D5nQ== 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:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=P0GE70VPxyQ7vl2EPcvyPLeZFVeX8Yx7tGcr6qvdj6o=; b=0ma9u8fsJZWSAlT9Y991oYti0lHdODRb8Ys+MWVkQaEZCP5PtTzeG5b2UtPbtANar4 Wni4RCp3/ZHDg1Qs/2fezMfkG39DYwyWBDNY9K8BgDvmw5CERg4hW5gWrv6M8HC8V30Y Jcx/KLB8uNZOxEyUTr6Oi1qZsoFtYwXAyowvNCqq6Gvb0Wtzkkja0gi4J6E+F7HgDXvx u6KajnCZcpGzAfLvooD6B5fooL47w6kfLl1IXxqWeyXaV6ZqjiPMjBnYOgaZz+Sz9b5u zRBe9ocFA2QDGxGU/aWRwLmASHD3t+WPp2XKs/hmW0h0JNxmiTQqdJ98HFYZ2UrSMfuR 4imQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=uPubk21j; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id jz18si6540389ejb.112.2020.05.11.13.13.51; Mon, 11 May 2020 13:14:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-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=@kernel.org header.s=default header.b=uPubk21j; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731320AbgEKUL6 (ORCPT + 99 others); Mon, 11 May 2020 16:11:58 -0400 Received: from mail.kernel.org ([198.145.29.99]:52862 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729215AbgEKUL6 (ORCPT ); Mon, 11 May 2020 16:11:58 -0400 Received: from localhost.localdomain (c-73-231-172-41.hsd1.ca.comcast.net [73.231.172.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 59BD3206F5; Mon, 11 May 2020 20:11:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1589227916; bh=BAT96320Mf+ek7q+6TUr2heEI1ld3mlQvzBygXm4ikE=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=uPubk21j63Zr9AqxVjUUQOVQXFKVjWUSWJfHwi1uxn3D00X6uBTsfwvupX7tc3PMl RTEdBA+0n4PZyJFKM9NPrKn4/wD6EqvnI91oTc2wka/nk7nEpQ024X7GzYEtSWHBXu 3xtLDutwV9/Oo3DqaGdV/W7ryzxKHu+R4Yb6cz8A= Date: Mon, 11 May 2020 13:11:55 -0700 From: Andrew Morton To: Charan Teja Reddy Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, vinmenon@codeaurora.org Subject: Re: [PATCH] mm, page_alloc: reset the zone->watermark_boost early Message-Id: <20200511131155.0b40ee443c3367e8f748b16f@linux-foundation.org> In-Reply-To: <1589204408-5152-1-git-send-email-charante@codeaurora.org> References: <1589204408-5152-1-git-send-email-charante@codeaurora.org> X-Mailer: Sylpheed 3.5.1 (GTK+ 2.24.31; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 11 May 2020 19:10:08 +0530 Charan Teja Reddy wrote: > Updating the zone watermarks by any means, like extra_free_kbytes, > min_free_kbytes, water_mark_scale_factor e.t.c, when watermark_boost is > set will result into the higher low and high watermarks than the user > asks. This can be avoided by resetting the zone->watermark_boost to zero > early. Does this solve some problem which has been observed in testing? > ... > > --- a/mm/page_alloc.c > +++ b/mm/page_alloc.c > @@ -7746,9 +7746,9 @@ static void __setup_per_zone_wmarks(void) > mult_frac(zone_managed_pages(zone), > watermark_scale_factor, 10000)); > > + zone->watermark_boost = 0; > zone->_watermark[WMARK_LOW] = min_wmark_pages(zone) + tmp; > zone->_watermark[WMARK_HIGH] = min_wmark_pages(zone) + tmp * 2; > - zone->watermark_boost = 0; > > spin_unlock_irqrestore(&zone->lock, flags); > } This could only be a problem if code is accessing these things without holding zone->lock. Is that ever the case?