Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932729AbaFEAq6 (ORCPT ); Wed, 4 Jun 2014 20:46:58 -0400 Received: from linuxhacker.ru ([217.76.32.60]:47130 "EHLO fiona.linuxhacker.ru" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757204AbaFEAqz convert rfc822-to-8bit (ORCPT ); Wed, 4 Jun 2014 20:46:55 -0400 Subject: Re: [patch v2] mm, pcp: allow restoring percpu_pagelist_fraction default Mime-Version: 1.0 (Apple Message framework v1283) Content-Type: text/plain; charset=us-ascii From: Oleg Drokin In-Reply-To: Date: Wed, 4 Jun 2014 20:46:05 -0400 Cc: Andrew Morton , Rik van Riel , Mel Gorman , Cody P Schafer , Randy Dunlap , linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-doc@vger.kernel.org, devel@driverdev.osuosl.org Content-Transfer-Encoding: 8BIT Message-Id: References: <1399166883-514-1-git-send-email-green@linuxhacker.ru> <2C763027-307F-4BC0-8C0A-7E3D5957A4DA@linuxhacker.ru> <85AFB547-D3A1-4818-AD82-FF90909775D2@linuxhacker.ru> To: David Rientjes X-Mailer: Apple Mail (2.1283) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello! On Jun 4, 2014, at 8:34 PM, David Rientjes wrote: > @@ -5850,23 +5851,39 @@ int percpu_pagelist_fraction_sysctl_handler(ctl_table *table, int write, > void __user *buffer, size_t *length, loff_t *ppos) > { > struct zone *zone; > - unsigned int cpu; > + int old_percpu_pagelist_fraction; > int ret; > > + mutex_lock(&pcp_batch_high_lock); > + old_percpu_pagelist_fraction = percpu_pagelist_fraction; > + > ret = proc_dointvec_minmax(table, write, buffer, length, ppos); > - if (!write || (ret < 0)) > - return ret; > + if (!write || ret < 0) > + goto out; > + > + /* Sanity checking to avoid pcp imbalance */ > + if (percpu_pagelist_fraction && > + percpu_pagelist_fraction < MIN_PERCPU_PAGELIST_FRACTION) { > + percpu_pagelist_fraction = old_percpu_pagelist_fraction; > + ret = -EINVAL; > + goto out; > + } > + > + ret = 0; Minor nitpick I guess, but ret cannot be anything but 0 here I think (until somebody changes the way proc_dointvec_minmax for write=true operates)? The patch is good otherwise. Thanks.-- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/