Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp650208imm; Wed, 13 Jun 2018 06:22:16 -0700 (PDT) X-Google-Smtp-Source: ADUXVKI3b3F5L7R77EoVxv70an8dD3x9jg1D/h4bd5ugPto5G7L/cLzSI0bt2L09IFX5P/RNONCi X-Received: by 2002:a63:2bc4:: with SMTP id r187-v6mr4106551pgr.231.1528896136348; Wed, 13 Jun 2018 06:22:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528896136; cv=none; d=google.com; s=arc-20160816; b=r38PCiItSwDAfICYgmrgC16MnzYif3DNLrs8otqCfVTImoXcJpvVkS85QgQ7JP31j7 1/Slh7XtTOp+MKc1jycasQ7XVsfCGsXy3MTqkUUCF6rcN7qFsIp8WaD0bVM7gu+8J6uG Ywbad/tdO7yA6BF8CkCKjk8ZiuYeKjhwzFcmnDmGYJ6JcPgsjyQ/XXBoYuP3sbYBAJhd Zt8qFFtNUzFQ9JKPoekNxijz92ziZpzT02uiloV27/uH5r1aomZKTKuzohW3Qadj6voN iYkmOgD17+5KTbIIzkyVEdYBY0+tzQTomM3lSlfNHFfVa01dkvxmVqjnBrF2T/oHe7VM l6RA== 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=f6/BKjFmSoCZFHvT1WR/XSY8tsp5c7GJu8xykBeHbi4=; b=KuQ+kPxpufEPvbACbE6HbKslstoXwluFIvDC0ywa2cc6sdW9Io2x7pcGX27zxuz0Ts 2V2EE6at9hJjS8vS2cxPKwrYoUx6Jf0yJZRIzH4WocL2pzCDCHlbMF1Q1m78nqYLpSLc 3wrtCuCOB+VQNkdkYErYZdTBxP6wP6AzNaUqiV8bQjxYjyGRGi48hmzqUZu7YsPFcuyt ps3j99ulqc510ElVfnk6panxrR4vTcOxjvxsmKs21LucpcxGf+KVcuE1tcjSKp1WWAEX Qo14XlkjLDcXYGVoghdOrsFkS0Ved/7dwvGEuGqEKILtzHS1pNwRqrMXfLqA0B+zpB29 /fsg== 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 t5-v6si2956589plj.112.2018.06.13.06.22.01; Wed, 13 Jun 2018 06:22:16 -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 S935599AbeFMNVD (ORCPT + 99 others); Wed, 13 Jun 2018 09:21:03 -0400 Received: from www262.sakura.ne.jp ([202.181.97.72]:63817 "EHLO www262.sakura.ne.jp" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S935375AbeFMNVC (ORCPT ); Wed, 13 Jun 2018 09:21:02 -0400 Received: from fsav304.sakura.ne.jp (fsav304.sakura.ne.jp [153.120.85.135]) by www262.sakura.ne.jp (8.15.2/8.15.2) with ESMTP id w5DDKpQa065055; Wed, 13 Jun 2018 22:20:51 +0900 (JST) (envelope-from penguin-kernel@i-love.sakura.ne.jp) Received: from www262.sakura.ne.jp (202.181.97.72) by fsav304.sakura.ne.jp (F-Secure/fsigk_smtp/530/fsav304.sakura.ne.jp); Wed, 13 Jun 2018 22:20:51 +0900 (JST) X-Virus-Status: clean(F-Secure/fsigk_smtp/530/fsav304.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 w5DDKkL4064988 (version=TLSv1.2 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 13 Jun 2018 22:20:51 +0900 (JST) (envelope-from penguin-kernel@i-love.sakura.ne.jp) Subject: Re: [rfc patch] mm, oom: fix unnecessary killing of additional processes To: Michal Hocko , David Rientjes Cc: Andrew Morton , linux-kernel@vger.kernel.org, linux-mm@kvack.org References: <20180525072636.GE11881@dhcp22.suse.cz> <20180528081345.GD1517@dhcp22.suse.cz> <20180531063212.GF15278@dhcp22.suse.cz> <20180601074642.GW15278@dhcp22.suse.cz> <20180605085707.GV19202@dhcp22.suse.cz> From: Tetsuo Handa Message-ID: <56138495-fd91-62f8-464a-db9960bfeb28@i-love.sakura.ne.jp> Date: Wed, 13 Jun 2018 22:20:49 +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: <20180605085707.GV19202@dhcp22.suse.cz> 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/05 17:57, Michal Hocko wrote: >> For this reason, we see testing harnesses often oom killed immediately >> after running a unittest that stresses reclaim or compaction by inducing a >> system-wide oom condition. The harness spawns the unittest which spawns >> an antagonist memory hog that is intended to be oom killed. When memory >> is mlocked or there are a large number of threads faulting memory for the >> antagonist, the unittest and the harness itself get oom killed because the >> oom reaper sets MMF_OOM_SKIP; this ends up happening a lot on powerpc. >> The memory hog has mm->mmap_sem readers queued ahead of a writer that is >> doing mmap() so the oom reaper can't grab the sem quickly enough. > > How come the writer doesn't back off. mmap paths should be taking an > exclusive mmap sem in killable sleep so it should back off. Or is the > holder of the lock deep inside mmap path doing something else and not > backing out with the exclusive lock held? > Here is an example where the writer doesn't back off. http://lkml.kernel.org/r/20180607150546.1c7db21f70221008e14b8bb8@linux-foundation.org down_write_killable(&mm->mmap_sem) is nothing but increasing the possibility of successfully back off. There is no guarantee that the owner of that exclusive mmap sem will not be blocked by other unkillable waits.