Received: by 2002:ac2:464d:0:0:0:0:0 with SMTP id s13csp3260789lfo; Mon, 23 May 2022 00:13:28 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwHJrXhjxboqSTZrgTrJiYflYUznA8Z7M6D5E2PSD0vexNWSuxVSCe7FcljW4ifUtJtY0Er X-Received: by 2002:a17:902:b107:b0:161:db34:61ea with SMTP id q7-20020a170902b10700b00161db3461eamr20208516plr.27.1653290008016; Mon, 23 May 2022 00:13:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653290008; cv=none; d=google.com; s=arc-20160816; b=FxlN4bsEF1+Q0ZUA8r7hPWb1MZxxBjIzgHinPuFy5Nriy488eNkmqIREfNKHgQaFYs w7Y0u8JmP4pWQKffMuTJM6fjWm0ujG8YH/r12SwR1XvnKclQO1a/l641VPf5o5aTDPtb 8ZbcpLP009jeRSE16G/iERMB+d5m5PXOC3BRW96zTJyRMUv0lTvkGOfC3YUFFpwRa94A uCcH5fpY2HR+ZGKcvafURknYARMAf4+U9ihYWOdwlIBYiXtlKSwuiM5e0j132VHfCBnY q8205DWk8WO1rB6OQjyKWRA9T1YtXjOnQMLgnaTSGFBhTI85eGY/u3YeBwgZZSu+RE4L 4e8g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:to:content-language:subject:cc:user-agent:mime-version :date:message-id:dkim-signature; bh=eAU28GZ65hXLTfZUivY2QKlK5dFrYmLGcqUYiARA36o=; b=U42dABbtgCWU27/LuiI6oAndVFLqQ8TMQIzALL3lU8GjNbNZUTnbtU4IIZTkes3YmM j+o4QNB7CS3euIxkeIZwN0ZsumLX36PsVIeoV1LMtM/WRkNH5Si0+yP5EVRtTlq5VwdM Io5pbOAVF97cRFcf/3BYLPruBsyyEja20rVLKmNcEtU9byP3Ai5hvZ9vhMp2h3Cyx0MK 0Vd9GDvofPlE7jid9Gj1ncOcZN453yCse9YOa/ajCfy9vhk7O9Kq4zPnTePPrwNv7TRy ivpQ2G9x9NLRuXldKwKvMcng7ZBQjpPz9CVnoG9ePPd8mrJPu8rvtPF3JRKiaovf3M3N 1Iuw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=QMt257LM; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=collabora.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id y4-20020a1709029b8400b001620ad77764si7378516plp.522.2022.05.23.00.13.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 May 2022 00:13:28 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=QMt257LM; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=collabora.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 279E5BE22; Sun, 22 May 2022 23:31:45 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244044AbiEUOBv (ORCPT + 99 others); Sat, 21 May 2022 10:01:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60074 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237191AbiEUOBu (ORCPT ); Sat, 21 May 2022 10:01:50 -0400 Received: from bhuna.collabora.co.uk (bhuna.collabora.co.uk [46.235.227.227]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AF4E237BCF; Sat, 21 May 2022 07:01:48 -0700 (PDT) Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: usama.anjum) with ESMTPSA id 4D5FE1F45985 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1653141707; bh=bRgwLFLkiauCbXyihimErrttLo91tws84Q5eVV4ePsQ=; h=Date:Cc:Subject:To:References:From:In-Reply-To:From; b=QMt257LM9O7uhUZ0il2kM2g42JZW0uaFL9+D3OM1Piezy1z3sbUqr1uQIN5D62j5+ q2RiSw9kg/vP8US2mmcqXrKJ6byRIR2PvvDFj1w/tJtUglA011Watq8CMh8AHkDuO9 GnXVfnftWJCX5zBWQNmAbJv5UTffp7RfOpEZEXGEpAhNVTzHKFcyxVuNHMvWI00Snz jMjA18KPwqvS9Oykj2hZtbYnKyESerX31uo8wRi8f8khVJPsfZQrqq6sKy9ha7phL3 MeCZUQAWDzHl78m7VlOcbRzsrT1oCsQOYFYOCnLMiAsfMfode+LFv44wcYYcFJAIfJ s/eoHUfgdmmaA== Message-ID: <27062abb-4ca1-b017-448b-f5529232cbdb@collabora.com> Date: Sat, 21 May 2022 19:01:33 +0500 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.8.0 Cc: usama.anjum@collabora.com, mhocko@suse.com, rientjes@google.com, willy@infradead.org, hannes@cmpxchg.org, guro@fb.com, minchan@kernel.org, kirill@shutemov.name, aarcange@redhat.com, brauner@kernel.org, hch@infradead.org, oleg@redhat.com, david@redhat.com, jannh@google.com, shakeelb@google.com, peterx@redhat.com, jhubbard@nvidia.com, shuah@kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-kselftest@vger.kernel.org, kernel-team@android.com Subject: Re: [PATCH v3 1/1] selftests: vm: add process_mrelease tests Content-Language: en-US To: Suren Baghdasaryan , akpm@linux-foundation.org References: <20220518204316.13131-1-surenb@google.com> From: Muhammad Usama Anjum In-Reply-To: <20220518204316.13131-1-surenb@google.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-3.2 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,NICE_REPLY_A,RDNS_NONE,SPF_HELO_NONE, T_SCC_BODY_TEXT_LINE,UNPARSEABLE_RELAY autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 5/19/22 1:43 AM, 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: > > $ mrelease_test > Success reaping a child with 1MB of memory allocations > > On failure the test reports the failure. Sample outputs: > > $ mrelease_test > All process_mrelease attempts failed! > > $ mrelease_test > process_mrelease: Invalid argument > > Signed-off-by: Suren Baghdasaryan Reviewed-by: Muhammad Usama Anjum -- Muhammad Usama Anjum