Received: by 10.223.185.116 with SMTP id b49csp1029833wrg; Wed, 21 Feb 2018 10:51:39 -0800 (PST) X-Google-Smtp-Source: AH8x227qp55RCKuIEc0ewEu1KJyddJo1hMQMLxnz6MAbuMzUUWqqLodBFkjSeUyDKsEjOQw7uZ7P X-Received: by 10.98.8.92 with SMTP id c89mr3051052pfd.154.1519239099499; Wed, 21 Feb 2018 10:51:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519239099; cv=none; d=google.com; s=arc-20160816; b=ebVo1f0pd5Uk6sL1y1upOX5DwGdPsCt4mqUykRX44h3Vrc6ZlffUMn5M6dd+e8VAPE uzeK+FO8/fJJAz15ieKRrGSCT+HvlnuIwjm3wmx7OxmEqd7e5738ul6iy0klGHBj1l+G L/FGRVe3kAU2myLpOUXs2TIJGKJxs9Wfz0mWlnGvJhCfqH3JuzD3UTo27FUyjOH4eefn NxaHRzVH5weO2hldJ23q/6ipOkxNvK1Sroqo+5vjEVYlbtUx6Srv4jmwJu75Jj8f3mdj unypCgJ5eOapRmShkK82fTe+ed2I93M8XgedPdX7eMtj8zpztr1YpcnTUFGYubfgs384 ungg== 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 :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=72VSGO2dFgtSUsFYyqF9kGtz7Mv+9pYSTaxnOEKFuZI=; b=uNPK27BqsbUeZu9zVV0MqhlN3Z9Jt4l30UBQZlY92T66oOVtpd7oFa8/sny11OLJaK erly9fx+CmisIikTLY6kfYyQfgjwJWzpyFs8aVq0INQtyGFuQjrf3EDGeH4P6FTczlEA gyGL6yw3jgCqHqDG6oWJFtgeqdrzCU4RCiUtJT0y2Dwv6vcBeuLQNpDxmJsvlpcckIYi SEuj1MiGPabEwec0OmNFs7FjmBxlCTHHvI5mfADvzarXeX5jcRufKEjVeVpC08uE1P9J 9a0W4jjw378O2PiefKfi5fw0f2paDb4HwqLN64IhqI7rFOo0q/5gYPRUZaQ+1GfPJyaf y18Q== 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 m11-v6si8225037pln.320.2018.02.21.10.51.25; Wed, 21 Feb 2018 10:51:39 -0800 (PST) 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 S965030AbeBUOYO (ORCPT + 99 others); Wed, 21 Feb 2018 09:24:14 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:35976 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934800AbeBUM55 (ORCPT ); Wed, 21 Feb 2018 07:57:57 -0500 Received: from localhost (LFbn-1-12258-90.w90-92.abo.wanadoo.fr [90.92.71.90]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 4C62BF64; Wed, 21 Feb 2018 12:57:56 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Naresh Kamboju , Arnd Bergmann , Shuah Khan Subject: [PATCH 4.14 010/167] kselftest: fix OOM in memory compaction test Date: Wed, 21 Feb 2018 13:47:01 +0100 Message-Id: <20180221124525.170302793@linuxfoundation.org> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180221124524.639039577@linuxfoundation.org> References: <20180221124524.639039577@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.14-stable review patch. If anyone has any objections, please let me know. ------------------ From: Arnd Bergmann commit 4c1baad223906943b595a887305f2e8124821dad upstream. Running the compaction_test sometimes results in out-of-memory failures. When I debugged this, it turned out that the code to reset the number of hugepages to the initial value is simply broken since we write into an open sysctl file descriptor multiple times without seeking back to the start. Adding the lseek here fixes the problem. Cc: stable@vger.kernel.org Reported-by: Naresh Kamboju Link: https://bugs.linaro.org/show_bug.cgi?id=3145 Signed-off-by: Arnd Bergmann Signed-off-by: Shuah Khan Signed-off-by: Greg Kroah-Hartman --- tools/testing/selftests/vm/compaction_test.c | 2 ++ 1 file changed, 2 insertions(+) --- a/tools/testing/selftests/vm/compaction_test.c +++ b/tools/testing/selftests/vm/compaction_test.c @@ -137,6 +137,8 @@ int check_compaction(unsigned long mem_f printf("No of huge pages allocated = %d\n", (atoi(nr_hugepages))); + lseek(fd, 0, SEEK_SET); + if (write(fd, initial_nr_hugepages, strlen(initial_nr_hugepages)) != strlen(initial_nr_hugepages)) { perror("Failed to write value to /proc/sys/vm/nr_hugepages\n");