Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp563810ybt; Mon, 6 Jul 2020 16:43:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJweir/IcOv9CIKqC7J8Xo0/7oMunm4gVBC9+1/SlWsFvFkUauyZwbH3MDlI577me9IzIcmJ X-Received: by 2002:a50:ba8b:: with SMTP id x11mr60178078ede.201.1594078996878; Mon, 06 Jul 2020 16:43:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594078996; cv=none; d=google.com; s=arc-20160816; b=wOFI5OEFL9DIyz8Y4dxEOobEPDPPjWc0eptmpu8lKaLNc+2/spC9Krt4WpKFLwT6DT tNEWYua2WDUA2ipQJQ8DD8FCsFHFHZdEsRVGw622jZWq8gYvClcSytSqDmd0qsqQH/1m LqIfRKAlr37L6F71hR7AuqFhnTvu/U+XgxDOqSJlAJVtdLERScxCTxNnC+/gQpROQAfP Ak7I+toL4myQ2WA6101XfkhzkL+5iD+3flkggVQJ3ClEDONkkOi+GBC6EPI8tlZcfEr6 wIOeep7PsVZaDrOCn2iYjZto7Vf09OElPToigPoYhOOZZaqfYMDBm1n7VJlogqUorf67 aeWg== 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=L3igZ0BAgZAzsxESuCEOWkeOAYRi/2rX7l+5exvHTV4=; b=sAPkxvEBejMw7EjztRYyt7AdjF2QGKVnSUGpdcchR1/3N1Y95QbjENSiRJi2Uk/r8Y zdKgx84Hpt7BLFtb8JdaiO8C4+8tHE9P4/pNSW3l7Oc4q4d0XJOENsXjtMyIaQJD0b1L fF6vaZLKTB40djvSO0qT33KyBBfW9Ghhfusv96sG4ZP3EOKngYmjTWGWpJPsDMODD0PX QlznGZPZKF9w+Vz+knSUHgKVtIG6VTOzIMt0HNIjLNgddWd5bxOX89AXNF7BH2Og+a7t LbyoPs+FzxYeRZKjdeadwW7TtOrID9mTi90MLpYg95tr/aVyVDleH1QcICb0DUj7lHIu ZvjQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=gf08immk; 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 w22si15169868eds.415.2020.07.06.16.42.54; Mon, 06 Jul 2020 16:43:16 -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=gf08immk; 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 S1727905AbgGFXmW (ORCPT + 99 others); Mon, 6 Jul 2020 19:42:22 -0400 Received: from mail.kernel.org ([198.145.29.99]:37984 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726280AbgGFXmV (ORCPT ); Mon, 6 Jul 2020 19:42:21 -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 C1FD2206E9; Mon, 6 Jul 2020 23:42:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1594078941; bh=t/nO/7PyzLhpBEiwo9upsXorfRn3O1Jz/2RyIvBEB5I=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=gf08immkIY0zN6dKfIodzmcYTFcyBsLPgNlF2Zxveg00m2kfu570Aa8vSheBrB4qA 9sJr1So6ZaP888dMXSbmFZZBkTvpsdR/c4hRv1ONC3MVK9hG57f452K2n3Nr1i0YBs atWUXl54/p//1sVSBkLN7G/yaHRCgNxao2HHpZ5I= Date: Mon, 6 Jul 2020 16:42:20 -0700 From: Andrew Morton To: Andi Kleen Cc: Feng Tang , Qian Cai , Dennis Zhou , Tejun Heo , Christoph Lameter , kernel test robot , Michal Hocko , Johannes Weiner , Matthew Wilcox , Mel Gorman , Kees Cook , Luis Chamberlain , Iurii Zaikin , tim.c.chen@intel.com, dave.hansen@intel.com, ying.huang@intel.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org, lkp@lists.01.org Subject: Re: [mm] 4e2c82a409: ltp.overcommit_memory01.fail Message-Id: <20200706164220.cc73e53c7f1b285910c82807@linux-foundation.org> In-Reply-To: <20200706133434.GA3483883@tassilo.jf.intel.com> References: <20200705044454.GA90533@shbuild999.sh.intel.com> <20200705125854.GA66252@shbuild999.sh.intel.com> <20200705155232.GA608@lca.pw> <20200706014313.GB66252@shbuild999.sh.intel.com> <20200706023614.GA1231@lca.pw> <20200706132443.GA34488@shbuild999.sh.intel.com> <20200706133434.GA3483883@tassilo.jf.intel.com> 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, 6 Jul 2020 06:34:34 -0700 Andi Kleen wrote: > > ret = proc_dointvec_minmax(table, write, buffer, lenp, ppos); > > - if (ret == 0 && write) > > + if (ret == 0 && write) { > > + if (sysctl_overcommit_memory == OVERCOMMIT_NEVER) > > + schedule_on_each_cpu(sync_overcommit_as); > > The schedule_on_each_cpu is not atomic, so the problem could still happen > in that window. > > I think it may be ok if it eventually resolves, but certainly needs > a comment explaining it. It sure does. The new exported-to-everything percpu_counter_sync() should have full formal documentation as well, please. > Can you do some stress testing toggling the > policy all the time on different CPUs and running the test on > other CPUs and see if the test fails? > > The other alternative would be to define some intermediate state > for the sysctl variable and only switch to never once the schedule_on_each_cpu > returned. But that's more complexity. > > > -Andi