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 picard.linux.it (picard.linux.it [213.254.12.146]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 4E2F2C4332F for ; Mon, 20 Dec 2021 09:54:55 +0000 (UTC) Received: from picard.linux.it (localhost [IPv6:::1]) by picard.linux.it (Postfix) with ESMTP id 4FFD73C9101 for ; Mon, 20 Dec 2021 10:54:53 +0100 (CET) Received: from in-4.smtp.seeweb.it (in-4.smtp.seeweb.it [IPv6:2001:4b78:1:20::4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by picard.linux.it (Postfix) with ESMTPS id 145603C9164 for ; Mon, 20 Dec 2021 10:54:29 +0100 (CET) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by in-4.smtp.seeweb.it (Postfix) with ESMTPS id 3B9781001158 for ; Mon, 20 Dec 2021 10:54:28 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1639994067; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=n2CqbIUYMfTG3mwXZF33r/Hf8ar+tajzXj96LX+z0QI=; b=EttTH/Utxu7uXrMvUM/LWuTYQFFTifkat8KPenKbHk99xZ/qyq2odTtAVs23tr5ESmTFXg F120pGE4X6Nmtbv2uVpZL8QuVdrMZn3L3o99UZcoxPBmPfEx9eAVxF81BWzW/r4vtSCH5+ WuCmegZFvq4JHfLtHLFYcIVufXwdp0Y= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-650-kNrbmBMkPtib0XL8Z0Q87A-1; Mon, 20 Dec 2021 04:54:24 -0500 X-MC-Unique: kNrbmBMkPtib0XL8Z0Q87A-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 6069664083; Mon, 20 Dec 2021 09:54:23 +0000 (UTC) Received: from liwang-workstation.nay.redhat.com (unknown [10.66.81.187]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4F7164E2A1; Mon, 20 Dec 2021 09:54:22 +0000 (UTC) From: Li Wang To: ltp@lists.linux.it Date: Mon, 20 Dec 2021 17:54:16 +0800 Message-Id: <20211220095416.583323-3-liwang@redhat.com> In-Reply-To: <20211220095416.583323-1-liwang@redhat.com> References: <20211220095416.583323-1-liwang@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=liwang@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Virus-Scanned: clamav-milter 0.102.4 at in-4.smtp.seeweb.it X-Virus-Status: Clean Subject: [LTP] [PATCH v3 3/3] oom: enable OOM protection for mem lib process X-BeenThere: ltp@lists.linux.it X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux Test Project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ltp-bounces+ltp=archiver.kernel.org@lists.linux.it Sender: "ltp" Just simply invoke oom protection on mem library to make it can collect full state of children. Signed-off-by: Li Wang Reviewed-by: Petr Vorel --- testcases/kernel/mem/lib/mem.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/testcases/kernel/mem/lib/mem.c b/testcases/kernel/mem/lib/mem.c index ac890491c..a4bede0df 100644 --- a/testcases/kernel/mem/lib/mem.c +++ b/testcases/kernel/mem/lib/mem.c @@ -129,8 +129,11 @@ void oom(int testcase, int lite, int retcode, int allow_sigkill) pid_t pid; int status, threads; + tst_enable_oom_protection(0); + switch (pid = SAFE_FORK()) { case 0: + tst_disable_oom_protection(0); threads = MAX(1, tst_ncpus() - 1); child_alloc(testcase, lite, threads); default: -- 2.31.1 -- Mailing list info: https://lists.linux.it/listinfo/ltp