From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 793E6C433EF for ; Mon, 16 May 2022 19:56:08 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id D01BD6B0072; Mon, 16 May 2022 15:56:07 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id CB1626B0073; Mon, 16 May 2022 15:56:07 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B7A266B0074; Mon, 16 May 2022 15:56:07 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id A9B7B6B0072 for ; Mon, 16 May 2022 15:56:07 -0400 (EDT) Received: from smtpin03.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay12.hostedemail.com (Postfix) with ESMTP id 850291215BA for ; Mon, 16 May 2022 19:56:07 +0000 (UTC) X-FDA: 79472662374.03.8B0792B Received: from mail-yw1-f170.google.com (mail-yw1-f170.google.com [209.85.128.170]) by imf06.hostedemail.com (Postfix) with ESMTP id 64AAF180050 for ; Mon, 16 May 2022 19:56:04 +0000 (UTC) Received: by mail-yw1-f170.google.com with SMTP id 00721157ae682-2ef5380669cso165530887b3.9 for ; Mon, 16 May 2022 12:56:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=gfdUgGfNk3YhrYyq3M5XkqZYdXGFDT0Zb8uEoLzPkM8=; b=IbUzpIJLiMA1ViYgX8Jh1WuzPhrzWpCO0cyMdjY1sJ+mXkV4jPmeKJBw5W5eO9KKBS uRl4UlkDdCc3g1sS5dZD019n8RtHIIk3qECd6qb/4ikg+MRFGGaFelI2t/rn3ZK3B+hI oaKFOJyjKr01aMhzFnjTvwhcJElVTtVAlh3dIHkrrvGKeTmsPoNZuTqwKG4iYiDPjH6i Pl6rxNfX0HBPcTlV2W5b6L9c+ihTzdpnxl7Uonsd19/fw1RBnwoXAyi4YX15wx2g+i96 6zkBCbMveUQud112L+2LH2jdgG9zouwGPHMibw7+vaCxAz5UJZkb0+1fayoiEaeo/nnI +iEQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=gfdUgGfNk3YhrYyq3M5XkqZYdXGFDT0Zb8uEoLzPkM8=; b=KbJMBJWNJhRwxfR1UnhhD7RE6qG0dMvZh7JeKcu1RGtx75qzf70vkRnR//xe/aULfM Mrk1xq/FEaXvaK5h+XFQUo08Vwr+7enrERya2n2V1R/ZhQlgMWzjd1bXz22CWmqJby59 D9RDdH2L9NNNQ3WBS/o9RM620exELY+mZydSkfgB/WL58hv2i5gyF/VRLYukpM+bK8oQ 8hnzpNs+d4Np2CxjQ8qpRs5rvcc479X0VU3lGulz3tSW+Ed8crpDsqrY77kCuMg6bobV Kzm/5aM0UhgBtq9mExKZ+KREP0W6ylyJrW+LYD6UgQZr5EgdvzjuvEA616s7h3Sgks6w /CLg== X-Gm-Message-State: AOAM531HcWGFJNmCtS9Cy2tY/1LqnDBiC82KWADyhohtqgwVFtsfcwAn 3in6wEwo0hPoRS14VySJ4tn8YFncqmgWHZtqhayJjw== X-Google-Smtp-Source: ABdhPJw3x6WiZ42hrjmcTLP0iMMy3DDxNMyaCjoU1W4evQaWFgcPdb6I1JcYc/LIUoqSxPyOjGqbk6G6OjkRzdfSZ28= X-Received: by 2002:a0d:d4d0:0:b0:2fe:b86b:472d with SMTP id w199-20020a0dd4d0000000b002feb86b472dmr19354893ywd.469.1652730966045; Mon, 16 May 2022 12:56:06 -0700 (PDT) MIME-Version: 1.0 References: <20220516075538.1276644-1-surenb@google.com> <20220516125010.53ab9a27733f361e5965ed7f@linux-foundation.org> In-Reply-To: <20220516125010.53ab9a27733f361e5965ed7f@linux-foundation.org> From: Suren Baghdasaryan Date: Mon, 16 May 2022 12:55:55 -0700 Message-ID: Subject: Re: [PATCH v2 1/1] selftests: vm: add process_mrelease tests To: Andrew Morton Cc: Michal Hocko , David Rientjes , Matthew Wilcox , Johannes Weiner , Roman Gushchin , Minchan Kim , "Kirill A. Shutemov" , Andrea Arcangeli , Christian Brauner , Christoph Hellwig , Oleg Nesterov , David Hildenbrand , Jann Horn , Shakeel Butt , Peter Xu , John Hubbard , shuah@kernel.org, LKML , linux-mm , linux-kselftest@vger.kernel.org, kernel-team Content-Type: text/plain; charset="UTF-8" X-Stat-Signature: ysn4iheiyu9keuzzuba8nkzufezzahwo X-Rspamd-Server: rspam12 X-Rspamd-Queue-Id: 64AAF180050 Authentication-Results: imf06.hostedemail.com; dkim=pass header.d=google.com header.s=20210112 header.b=IbUzpIJL; spf=pass (imf06.hostedemail.com: domain of surenb@google.com designates 209.85.128.170 as permitted sender) smtp.mailfrom=surenb@google.com; dmarc=pass (policy=reject) header.from=google.com X-Rspam-User: X-HE-Tag: 1652730964-750219 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Mon, May 16, 2022 at 12:50 PM Andrew Morton wrote: > > On Mon, 16 May 2022 00:55:38 -0700 Suren Baghdasaryan wrote: > > > Introduce process_mrelease syscall sanity tests which include tests > > which expect to fail: > > - process_mrelease with invalid pidfd and flags inputs > > - process_mrelease on a live process with no pending signals > > and valid process_mrelease usage which is expected to succeed. > > Because process_mrelease has to be used against a process with a pending > > SIGKILL, it's possible that the process exits before process_mrelease > > gets called. In such cases we retry the test with a victim that allocates > > twice more memory up to 1GB. This would require the victim process to > > spend more time during exit and process_mrelease has a better chance of > > catching the process before it exits and succeeding. > > > > On success the test reports the amount of memory the child had to > > allocate for reaping to succeed. Sample output: > > Success reaping a child with 1MB of memory allocations > > > > On failure the test reports the failure. Sample outputs: > > All process_mrelease attempts failed! > > process_mrelease: Invalid argument > > > > ... > > > > --- a/tools/testing/selftests/vm/run_vmtests.sh > > +++ b/tools/testing/selftests/vm/run_vmtests.sh > > @@ -287,6 +287,22 @@ else > > echo "[PASS]" > > fi > > > > +echo "---------------------" > > +echo "running mrelease_test" > > +echo "---------------------" > > +./mrelease_test > > +ret_val=$? > > + > > +if [ $ret_val -eq 0 ]; then > > + echo "[PASS]" > > +elif [ $ret_val -eq $ksft_skip ]; then > > + echo "[SKIP]" > > + exitcode=$ksft_skip > > +else > > + echo "[FAIL]" > > + exitcode=1 > > +fi > > + > > echo "-------------------" > > echo "running mremap_test" > > echo "-------------------" > > Can you please redo this against > git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm branch mm-stable > or mm-unstable. Or against linux-next? > > This script now has a helper function run_test which I think can be > used here. Ah, thanks for the note! I'll give it a couple days for more reviews and the will post it over mmotm.