Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp5543836imm; Tue, 26 Jun 2018 13:12:29 -0700 (PDT) X-Google-Smtp-Source: AAOMgpevrNQnPpoOrb7PYntVLFrMRjoFn85J9kiNIfjCHBpO6Fbp9IV7Hw5m3mp9CZ0ZEZRlkBmR X-Received: by 2002:a65:5246:: with SMTP id q6-v6mr2584913pgp.152.1530043949342; Tue, 26 Jun 2018 13:12:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530043949; cv=none; d=google.com; s=arc-20160816; b=UmvTDj/M3cq9QkajllJIAb9HlLkIgsiV78tNskoao+sHohfIwkFECYjRSQjPg8UiHp yDHbKPyqVkAJZRIr13mxlIimRELg+mfKvO3kw5ylW/CABTUAdOqGcgZFXXXbRx1eFMbb Cuo73zqJQABzoh149z+HjojhXGrm+kJoFiCbx4VDN0VruCDgXeiKA49Y3n8r2A+s6FTY Dn+yJX1qa3wQTVvX4pLkSy2V7daPZZqi9oPka/1Zom6QkjV59tWWYpbgJHfJHyy/lAgN UKdfo8GTNEtlxxDhewZT2JzSYZh8uKFgqD6ti1yF35hvEKth9cOVGMDtpaa9zm+bCDlg r12w== 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 :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:arc-authentication-results; bh=mkGdK+jcav84CEVpU5pcl5nH9EVBNog6uk4sv6/HQ3U=; b=z21WPeJxcD7qnimnxUoJZGymlxynqZq+LSW7GmAcJhUSIr4E2E4+Tujl+OfX7TwFyo DCXiT84TlulzPUDpJ9NzpEHwacKV7wd41inGiyaJ0PmeKI1aIucyEJOFsynwJjW/iw7l T7rIDd5CiQ7zdQwShRLGxDCARAavNpjyTYruLkQQEQDlXrqVzth6UalPqDHpjFixBRdH pzmwt/+jrLKIFYgWGM/vXqofXQxLc1vJQxKEemmYd+a1Z45NO9ZAElmuu9eZcu86HuNu Z4YaPCkbTbTddYK2MFjZ/Ggr2bL3JH41TIaY8Wig94UTisqwpKTT+Ao1VFPqaCMkyzYT xAxg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t127-v6si2297679pfc.174.2018.06.26.13.12.14; Tue, 26 Jun 2018 13:12:29 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754918AbeFZULK (ORCPT + 99 others); Tue, 26 Jun 2018 16:11:10 -0400 Received: from www262.sakura.ne.jp ([202.181.97.72]:48967 "EHLO www262.sakura.ne.jp" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752338AbeFZULJ (ORCPT ); Tue, 26 Jun 2018 16:11:09 -0400 Received: from fsav105.sakura.ne.jp (fsav105.sakura.ne.jp [27.133.134.232]) by www262.sakura.ne.jp (8.15.2/8.15.2) with ESMTP id w5QKAuxJ035369; Wed, 27 Jun 2018 05:10:56 +0900 (JST) (envelope-from penguin-kernel@i-love.sakura.ne.jp) Received: from www262.sakura.ne.jp (202.181.97.72) by fsav105.sakura.ne.jp (F-Secure/fsigk_smtp/530/fsav105.sakura.ne.jp); Wed, 27 Jun 2018 05:10:56 +0900 (JST) X-Virus-Status: clean(F-Secure/fsigk_smtp/530/fsav105.sakura.ne.jp) Received: from [192.168.1.8] (softbank126074194044.bbtec.net [126.74.194.44]) (authenticated bits=0) by www262.sakura.ne.jp (8.15.2/8.15.2) with ESMTPSA id w5QKAo1Z035357 (version=TLSv1.2 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 27 Jun 2018 05:10:56 +0900 (JST) (envelope-from penguin-kernel@i-love.sakura.ne.jp) Subject: Re: [PATCH] mm,oom: Bring OOM notifier callbacks to outside of OOM killer. To: paulmck@linux.vnet.ibm.com Cc: Michal Hocko , David Rientjes , linux-mm@kvack.org, Andrew Morton , linux-kernel@vger.kernel.org References: <1529493638-6389-1-git-send-email-penguin-kernel@I-love.SAKURA.ne.jp> <20180621073142.GA10465@dhcp22.suse.cz> <2d8c3056-1bc2-9a32-d745-ab328fd587a1@i-love.sakura.ne.jp> <20180626170345.GA3593@linux.vnet.ibm.com> From: Tetsuo Handa Message-ID: Date: Wed, 27 Jun 2018 05:10:48 +0900 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 In-Reply-To: <20180626170345.GA3593@linux.vnet.ibm.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2018/06/27 2:03, Paul E. McKenney wrote: > There are a lot of ways it could be made concurrency safe. If you need > me to do this, please do let me know. > > That said, the way it is now written, if you invoke rcu_oom_notify() > twice in a row, the second invocation will wait until the memory from > the first invocation is freed. What do you want me to do if you invoke > me concurrently? > > 1. One invocation "wins", waits for the earlier callbacks to > complete, then encourages any subsequent callbacks to be > processed more quickly. The other invocations return > immediately without doing anything. > > 2. The invocations serialize, with each invocation waiting for > the callbacks from previous invocation (in mutex_lock() order > or some such), and then starting a new round. > > 3. Something else? > > Thanx, Paul As far as I can see, - atomic_set(&oom_callback_count, 1); + atomic_inc(&oom_callback_count); should be sufficient.