Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp56726imm; Tue, 24 Jul 2018 13:57:13 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdqqqC+ZgYkWMpFWuIWzX+HWinYXKT5v+/SM2D/VTkMmw6DBMngNC4YclOWMmAe/Bd5GjPp X-Received: by 2002:a17:902:6e09:: with SMTP id u9-v6mr17960946plk.13.1532465833171; Tue, 24 Jul 2018 13:57:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532465833; cv=none; d=google.com; s=arc-20160816; b=eHBtsFtBi/x1ftUJotVqy6Tavnm/iZ1rgbPPCqzFsXwL2OdE+TgZc1gloRC+uKdge2 +3MqvFG85pGvMXXnUblZlOIuhLXZdCoReykUid2EX73Di4pcmFVm0pQVM5Zrj4XiaYvq E1JIVth0Bc65Wancq8Wex27nBejMU0wLnrA6KF8G7xUQQ4au2LmrrYB0Dp5ZU9GCBdi+ vxBx8/VKWuvFtQ2p19Io4D3YSsRdCLYorpuS1FCfLMKrEu15EXdWNcA2mXjBFW9LT+Oo cfoq13HHQ2cxHsQmcteV6uu2R0dXNUE/Tq5r2kcTOcOopC2Yqfmp7u+MfjYEdajt/KvB /j4g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :message-id:in-reply-to:subject:cc:to:from:date:dkim-signature :arc-authentication-results; bh=okBAlDaxM0DNqW7zvcq7HlrqbxW7pHlut6qsdwTqoyk=; b=h6lT6q7OC3N0rvcJ6VDuq8i8sYJbxPA/YUOQU1pjJqENP9xyww1ppTG37kR6LVI6wq 4p2WOfVAkAEeYzBwQ7YLr7KGOVr5vFTRAwYwSOijzQHUCUPIEvJkO/mA/ffq9J2aWC42 15fG1j+IUdpqnJEFVfhnTwbU+0f1X3xkbwnJPSl94nsnFcJqxrBr6wrsfh2i7FjlGW2h yB+0cFz5vKH5DmruaNgBk+kGFCTOzAHMeePzmCkJdR29o7IwzuX24STGRVTfJAugMR7X iAjnySiiFVffSf/F3fvULZfjewwK3SAAxpI+Y0eSutB7zzNkrazQHkUSpzAsK5BD7e+a DjNw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=uxdT4kbG; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b2-v6si12688338pgc.541.2018.07.24.13.56.57; Tue, 24 Jul 2018 13:57:13 -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; dkim=pass header.i=@google.com header.s=20161025 header.b=uxdT4kbG; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388901AbeGXWDw (ORCPT + 99 others); Tue, 24 Jul 2018 18:03:52 -0400 Received: from mail-pg1-f195.google.com ([209.85.215.195]:42971 "EHLO mail-pg1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388640AbeGXWDv (ORCPT ); Tue, 24 Jul 2018 18:03:51 -0400 Received: by mail-pg1-f195.google.com with SMTP id y4-v6so3702435pgp.9 for ; Tue, 24 Jul 2018 13:55:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:from:to:cc:subject:in-reply-to:message-id:references :user-agent:mime-version; bh=okBAlDaxM0DNqW7zvcq7HlrqbxW7pHlut6qsdwTqoyk=; b=uxdT4kbGdTtAvJ75Nx4Uy4Gs4UPePCI9Ha0khp8C4ZP6fll5CyFVvR+wCteneUJXy/ Im3svmPSqS67CLvbBmQ+6grwETAKbPlDznYttjZKLmqQikspi+1KLSHFxwlrblHpiLQ4 SwYmgmfKmknGbWkPnRrUyqHgj5fZlDSoTGvKelLHSr4zqQbRQZK2RdGA/x9RivL2OJI4 W1H/P7iN2GoPnG9BBDZRtCYc2khgIy9hTe47+mIJD/AtA0YwLUQdUoHDkudTXwY3/JCm 33Wiowd/K7L0fAIGNUv78alTKx2DMJoAgKq7bj7gppmk9/34hw65ha5UEka1KWBM5YTf qzgQ== 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:in-reply-to:message-id :references:user-agent:mime-version; bh=okBAlDaxM0DNqW7zvcq7HlrqbxW7pHlut6qsdwTqoyk=; b=OuwGASXcUkPJfJqDKi3UxHbqph6xahtzYNigj8s0BuBMoswqfLo6LSxqNrkbbWXUOq a5gQVl1J8Sp0kw3gUkKG2Vt56guyRtBiOmkiEcEsdlNjsFHac82O7xh3jB+Qm9HOoNZZ +5FI+flloaC2aYQSlH9gjOF7lRjR9vEyzJquK2miz3MqqOj1CGy7Kldv1LcJ8+Vrtl9U U7TQ6wqfZ7kiRAhQ6DZTsYYwjEfvUWKC57X0aGGYh4Pgr1qdpF2Qkru7aC4GRTgErMeX 0GyKO4vwAwcvTklo6/EYC7qu319KuLABS9KJ/rv+5Skd0aLLHRNiD2C/6WFce+FS1JVe Lq8A== X-Gm-Message-State: AOUpUlG1oLYPE0hiGVMTKHaV6nPe4an7Zz/VTw0nS54N2/MUkxv0rDek zTyKSuKBWqG1vG9mT6vMweZtCOg7W/Y= X-Received: by 2002:a63:8c51:: with SMTP id q17-v6mr18229002pgn.236.1532465734584; Tue, 24 Jul 2018 13:55:34 -0700 (PDT) Received: from [2620:15c:17:3:3a5:23a7:5e32:4598] ([2620:15c:17:3:3a5:23a7:5e32:4598]) by smtp.gmail.com with ESMTPSA id l84-v6sm19409007pfg.3.2018.07.24.13.55.33 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 24 Jul 2018 13:55:33 -0700 (PDT) Date: Tue, 24 Jul 2018 13:55:33 -0700 (PDT) From: David Rientjes X-X-Sender: rientjes@chino.kir.corp.google.com To: Michal Hocko cc: Andrew Morton , Tetsuo Handa , linux-mm@kvack.org, LKML , Michal Hocko Subject: Re: [PATCH] mm, oom: remove oom_lock from oom_reaper In-Reply-To: <20180719075922.13784-1-mhocko@kernel.org> Message-ID: References: <20180719075922.13784-1-mhocko@kernel.org> User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 19 Jul 2018, Michal Hocko wrote: > From: Michal Hocko > > oom_reaper used to rely on the oom_lock since e2fe14564d33 ("oom_reaper: > close race with exiting task"). We do not really need the lock anymore > though. 212925802454 ("mm: oom: let oom_reap_task and exit_mmap run > concurrently") has removed serialization with the exit path based on the > mm reference count and so we do not really rely on the oom_lock anymore. > > Tetsuo was arguing that at least MMF_OOM_SKIP should be set under the > lock to prevent from races when the page allocator didn't manage to get > the freed (reaped) memory in __alloc_pages_may_oom but it sees the flag > later on and move on to another victim. Although this is possible in > principle let's wait for it to actually happen in real life before we > make the locking more complex again. > > Therefore remove the oom_lock for oom_reaper paths (both exit_mmap and > oom_reap_task_mm). The reaper serializes with exit_mmap by mmap_sem + > MMF_OOM_SKIP flag. There is no synchronization with out_of_memory path > now. > > Suggested-by: David Rientjes > Signed-off-by: Michal Hocko Acked-by: David Rientjes