Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp3904863ybz; Mon, 4 May 2020 11:52:23 -0700 (PDT) X-Google-Smtp-Source: APiQypKxlt6Iz/P5ILxpcpsCscnLe0vxo+2DBtBfsVTp3qlKDsQCdpdBWpJbaI1PVWbFIGEqjBfD X-Received: by 2002:a05:6402:48b:: with SMTP id k11mr16261452edv.47.1588618343054; Mon, 04 May 2020 11:52:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588618343; cv=none; d=google.com; s=arc-20160816; b=YCrQXOsVJR0yTRAih6YWMn6BbbITeoxpgbMk7Z65x0HYYX5vggqjONN6Hs9Fop9B7s kthSNcjLF5Zw/EeQ3FYRy38w/7TYMSOnYJ7HUmTwVhVVPWUHYTX231mN4IlF9Hg1EPft MbRsp424DP6+eSeLBB5x5tknbFGa3/Qw+Mz1MyShXL/QNURoC2eHouNuRMYRBGgcXzQ1 Pa/JJCDU9sT+h84csae1Ap50GKou8ruaXmeBw3pDhsjI4HbvoR+cCg8MpNrx+Bs1JQkQ tg+iIV71rhsqvhw1tE3PNZuYgtnqPi58gqkwr3pc7SYHSOqeXO0yR2fiHNGRUdrXc995 lPgw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=W2tJ5b2t7hczpaAxFKlCfGf3HMAY03e+dltiT1wWRtw=; b=xgY8fkZlHym4gyzheRZ5d6gMFXowQTYWrjn10fDzYbOLRFPTV5NhVfnX31wrGXmMcd srsL4ChpcNQRUlUkROk9rDMgMw+j6vkwpz2zMvOsd1y8gRNPEYS77EgCtYfsyiBbZGFj r+UysiJM7CjhiRXw0EmobmTuNlduRCBHUVetYwJhtt5zgJ+apsbREBKTjLSeoyoOBeOv PpDFckIMu5FFZSUhRVcO0aHBmsMdh1GV29CCupvfA/VXUNolZPxdDheMhBHvw51c97h/ 7v+smqnhlK5aoubEt/WJKUXe6WPuAjFDjwPY/dqScIdhxu9uAouj5YtTqBxbVLYsUfs8 dB3w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=ZeNPUEFJ; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id e16si7085099eds.503.2020.05.04.11.52.00; Mon, 04 May 2020 11:52:23 -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=@chromium.org header.s=google header.b=ZeNPUEFJ; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727114AbgEDSmA (ORCPT + 99 others); Mon, 4 May 2020 14:42:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35316 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1726756AbgEDSl7 (ORCPT ); Mon, 4 May 2020 14:41:59 -0400 Received: from mail-pf1-x443.google.com (mail-pf1-x443.google.com [IPv6:2607:f8b0:4864:20::443]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A3E4FC061A0E for ; Mon, 4 May 2020 11:41:59 -0700 (PDT) Received: by mail-pf1-x443.google.com with SMTP id 18so5959776pfv.8 for ; Mon, 04 May 2020 11:41:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=W2tJ5b2t7hczpaAxFKlCfGf3HMAY03e+dltiT1wWRtw=; b=ZeNPUEFJK3Vzqz+6/aS6puuqVk/a8cosOmqzD7wITSt0oXSXn2EHXgOrzGqV7NeV1U tpNtoJ8OFz+o7A+cLKtE7CTdGQP15Cv/jR2PAAT/RkIvE7i4pWJs/yQJ9GoGzWr77iYi GoWITCOXJw3bA0fVyTcdTrgnW0VyEa9wuf8no= 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:message-id:references :mime-version:content-disposition:in-reply-to; bh=W2tJ5b2t7hczpaAxFKlCfGf3HMAY03e+dltiT1wWRtw=; b=jcGlwKWbI+m8GuEB4imqAJFBG1gfJkhBz1Xdw8adVIf6YJGIayQPj0uwNIXFsj7Hsd qfnttwEm/EyouJb8CEEY+VcvyIChquJjTtAumugobN4k3b/SUbt9Hpo/vC/8UbVS61i7 H/USx9Lvc/A6QRJ2ApNUuov9iXNRSPFckNKmAhp9FX37je6UBCzmGH4waapBsHE+Yi8n 5DuXtg7wCW12c7vn+/sXP4vbIYVuGSFM1GTun5fpQpzc6N9qzwxR4jT5hJPcqpobDxrl G1omhoe0A+vSu4uJFjyrV8uWCOYR59XvXgL/WNk2EWAbh6q3FcYVmUvYycEtoRNC/s+g /hgw== X-Gm-Message-State: AGi0PuY09fVK6y6dSEaQTiaZy8UfwiOVwB8R4bSfohP0zOC29RU9lP2S wDWFNwTlyQAJAux4DAjJJRF2bg== X-Received: by 2002:a62:4ec6:: with SMTP id c189mr19147132pfb.299.1588617719212; Mon, 04 May 2020 11:41:59 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id q6sm9253995pfh.193.2020.05.04.11.41.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 May 2020 11:41:58 -0700 (PDT) Date: Mon, 4 May 2020 11:41:57 -0700 From: Kees Cook To: Christoph Hellwig Cc: Iurii Zaikin , Alexei Starovoitov , Daniel Borkmann , linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-fsdevel@vger.kernel.org, netdev@vger.kernel.org, bpf@vger.kernel.org, David Rientjes Subject: Re: [PATCH 2/5] mm: remove watermark_boost_factor_sysctl_handler Message-ID: <202005041141.DA134ED931@keescook> References: <20200424064338.538313-1-hch@lst.de> <20200424064338.538313-3-hch@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200424064338.538313-3-hch@lst.de> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Apr 24, 2020 at 08:43:35AM +0200, Christoph Hellwig wrote: > watermark_boost_factor_sysctl_handler is just a pointless wrapper for > proc_dointvec_minmax, so remove it and use proc_dointvec_minmax > directly. > > Signed-off-by: Christoph Hellwig Reviewed-by: Kees Cook -Kees > Acked-by: David Rientjes > --- > include/linux/mmzone.h | 2 -- > kernel/sysctl.c | 2 +- > mm/page_alloc.c | 12 ------------ > 3 files changed, 1 insertion(+), 15 deletions(-) > > diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h > index 1b9de7d220fb7..f37bb8f187fc7 100644 > --- a/include/linux/mmzone.h > +++ b/include/linux/mmzone.h > @@ -911,8 +911,6 @@ static inline int is_highmem(struct zone *zone) > struct ctl_table; > int min_free_kbytes_sysctl_handler(struct ctl_table *, int, > void __user *, size_t *, loff_t *); > -int watermark_boost_factor_sysctl_handler(struct ctl_table *, int, > - void __user *, size_t *, loff_t *); > int watermark_scale_factor_sysctl_handler(struct ctl_table *, int, > void __user *, size_t *, loff_t *); > extern int sysctl_lowmem_reserve_ratio[MAX_NR_ZONES]; > diff --git a/kernel/sysctl.c b/kernel/sysctl.c > index 8a176d8727a3a..99d27acf46465 100644 > --- a/kernel/sysctl.c > +++ b/kernel/sysctl.c > @@ -1491,7 +1491,7 @@ static struct ctl_table vm_table[] = { > .data = &watermark_boost_factor, > .maxlen = sizeof(watermark_boost_factor), > .mode = 0644, > - .proc_handler = watermark_boost_factor_sysctl_handler, > + .proc_handler = proc_dointvec_minmax, > .extra1 = SYSCTL_ZERO, > }, > { > diff --git a/mm/page_alloc.c b/mm/page_alloc.c > index 69827d4fa0527..62c1550cd43ec 100644 > --- a/mm/page_alloc.c > +++ b/mm/page_alloc.c > @@ -7978,18 +7978,6 @@ int min_free_kbytes_sysctl_handler(struct ctl_table *table, int write, > return 0; > } > > -int watermark_boost_factor_sysctl_handler(struct ctl_table *table, int write, > - void __user *buffer, size_t *length, loff_t *ppos) > -{ > - int rc; > - > - rc = proc_dointvec_minmax(table, write, buffer, length, ppos); > - if (rc) > - return rc; > - > - return 0; > -} > - > int watermark_scale_factor_sysctl_handler(struct ctl_table *table, int write, > void __user *buffer, size_t *length, loff_t *ppos) > { > -- > 2.26.1 > -- Kees Cook