Received: by 10.223.176.5 with SMTP id f5csp712145wra; Fri, 9 Feb 2018 06:05:27 -0800 (PST) X-Google-Smtp-Source: AH8x226ujlTytDTKUZl0Uhfo6YzckLObVKaAH9cgeR7agDZy98uDndLufLq1QC2QT9gGjxz4QCcO X-Received: by 10.101.76.143 with SMTP id m15mr2507703pgt.445.1518185127538; Fri, 09 Feb 2018 06:05:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518185127; cv=none; d=google.com; s=arc-20160816; b=PoB7xhLucIqownUNdECjvlqUEMbbbG/p+DKW+MKZIq7BpwZddbjk8zyDEBo/2CO7Q+ n2UEj+NbAYmSE69hf8INvtsIuGAPhYVBzLxrNtSjXxVmNeFRq2mL6DfcAVTx7k0Ay1Uo /U6FZcao2vUhKqzawALmtzI+dStRrUq6zeiXD+AM1xoQHDyduJVT9GM6vfuAYa7xy12F bM9eoxIw+j7sgOmKIAICJ8FNWG3yjXOjKQ3j42rSfV7cjovsE54WCZ1uixAg4cnuzj9F apUZQU9iuzl6nJcVZxFRbMo2WUNEe+zPjPkfEaBdgL8U2Nd+mGk8Jbd+7uxhjb+2bUxY H8og== 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=THI8SYpBiXU7dO8L0UpT1YoZIcmzDtLFoo2Jh0Rv+TE=; b=hswFruoeOMJP6PAsx1w3ijTrPlRgbEQyhoVwNAq2AfRJRiRuC0YP+jxFCXnPgaIMoM //D6KvUQcBPrbo4Y/cHg9TGnM3NWC41EeTvNAZAbyDQ/lyHPOhRDU6Ub1nPALM2fVbLX k7aX8PhGepuZoB/gPfXgOO2sc7gSWqnzADI0HsyFvnj7re6uE/uuSXG4IvPG3cX3Hzom fbsVJuoAFI92JvkQISwiXkiV2JYejZi4r062J7yUJszXzletFsTf+pN9VNPcVMG4erLf DIp4l0RKgas36xv3qEFCkr9Egy95c3SBE4sbid7d7loIGZRp1NGlrAqJNODnU9U0Wnu5 4KxQ== 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 d189si1409115pgc.664.2018.02.09.06.05.13; Fri, 09 Feb 2018 06:05:27 -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 S1753218AbeBIOCF (ORCPT + 99 others); Fri, 9 Feb 2018 09:02:05 -0500 Received: from www62.your-server.de ([213.133.104.62]:38113 "EHLO www62.your-server.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751317AbeBIOCD (ORCPT ); Fri, 9 Feb 2018 09:02:03 -0500 Received: from [85.7.180.49] (helo=linux.home) by www62.your-server.de with esmtpsa (TLSv1.2:DHE-RSA-AES256-SHA:256) (Exim 4.85_2) (envelope-from ) id 1ek9FV-0003Hz-VY; Fri, 09 Feb 2018 15:01:58 +0100 Subject: Re: [Resend] Question: kselftests: bpf/test_maps failed To: Li Zhijian , "ast@kernel.org" , "shuah@kernel.org" , "linux-kselftest@vger.kernel.org" Cc: "linux-kernel@vger.kernel.org" , "Li, Philip" References: <747824f6-4877-69fe-9f1d-f3c18fed6a01@intel.com> From: Daniel Borkmann Message-ID: <40e0d564-cacb-7608-423e-eb85f5343521@iogearbox.net> Date: Fri, 9 Feb 2018 15:01:57 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 In-Reply-To: <747824f6-4877-69fe-9f1d-f3c18fed6a01@intel.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-Authenticated-Sender: daniel@iogearbox.net X-Virus-Scanned: Clear (ClamAV 0.99.3/24299/Fri Feb 9 10:20:36 2018) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 02/09/2018 06:14 AM, Li Zhijian wrote: > Hi > > INTEL 0-Day noticed that bpf/test_maps has different results at different platforms. > when it fails, the details are like Sorry for the late reply and thanks for reporting! More below: > ------------------ >   880 Failed to create hashmap key=16 value=131072 'Cannot allocate memory' >   881 Failed to create hashmap key=8 value=32768 'Cannot allocate memory' >   882 Failed to create hashmap key=8 value=131072 'Cannot allocate memory' >   883 Failed to create hashmap key=16 value=32768 'Cannot allocate memory' >   884 Failed to create hashmap key=8 value=16384 'Cannot allocate memory' >   885 Failed to create hashmap key=16 value=16384 'Cannot allocate memory' >   886 Failed to create hashmap key=8 value=65536 'Cannot allocate memory' >   887 Failed to create hashmap key=16 value=131072 'Cannot allocate memory' >   888 Failed to create hashmap key=16 value=32768 'Cannot allocate memory' >   889 Failed to create hashmap key=16 value=65536 'Cannot allocate memory' >   890 Failed to create hashmap key=8 value=65536 'Cannot allocate memory' >   891 Failed to create hashmap key=8 value=131072 'Cannot allocate memory' >   892 Failed to create hashmap key=8 value=131072 'Cannot allocate memory' >   893 Failed to create hashmap key=16 value=32768 'Cannot allocate memory' >   894 Failed to create hashmap key=8 value=16384 'Cannot allocate memory' >   895 Failed to create hashmap key=8 value=131072 'Cannot allocate memory' >   896 Failed to create hashmap key=16 value=8192 'Cannot allocate memory' >   897 Failed to create hashmap key=8 value=32768 'Cannot allocate memory' >   898 Failed to create hashmap key=16 value=8192 'Cannot allocate memory' >   899 Failed to create hashmap key=8 value=262144 'Cannot allocate memory' >   900 Failed to create hashmap key=8 value=262144 'Cannot allocate memory' >   901 Failed to create hashmap key=8 value=262144 'Cannot allocate memory' >   902 Failed to create hashmap key=16 value=262144 'Cannot allocate memory' >   903 Failed to create hashmap key=8 value=262144 'Cannot allocate memory' >   904 Failed to create hashmap key=8 value=262144 'Cannot allocate memory' >   905 test_maps: test_maps.c:955: run_parallel: Assertion `status == 0' failed. >   906 Aborted >   907 not ok 1..3 selftests:  test_maps [FAIL] > ------------------ > > After a simply looking at the code, looks it's related to the cpu number and system memory. > > below are the result under different platform > 1. Good > model: Sandy Bridge > nr_node: 1 > nr_cpu: 4 > memory: 6G > > 2. Good > model: qemu-system-x86_64 -enable-kvm > nr_cpu: 2 > memory: 4G > > 3. Bad > model: Ivytown Ivy Bridge-EP > nr_cpu: 48 > memory: 64G > > 4. Bad > model: Skylake > nr_cpu: 104 > memory: 64G > > I try to change the process number to 10 from 100, so it can pass at above Skylake(4) machine. > ------------ > lizhijian@haswell-OptiPlex-9020:~/lkp/linux/tools/testing/selftests/bpf$ git diff > diff --git a/tools/testing/selftests/bpf/test_maps.c b/tools/testing/selftests/bpf/test_maps.c > index 040356e..b788ca1 100644 > --- a/tools/testing/selftests/bpf/test_maps.c > +++ b/tools/testing/selftests/bpf/test_maps.c > @@ -960,7 +960,7 @@ static void test_map_stress(void) >  { >         run_parallel(100, test_hashmap, NULL); >         run_parallel(100, test_hashmap_percpu, NULL); > -       run_parallel(100, test_hashmap_sizes, NULL); > +       run_parallel(10, test_hashmap_sizes, NULL); >         run_parallel(100, test_hashmap_walk, NULL); >   >         run_parallel(100, test_arraymap, NULL); Unless Alexei has some better idea, I think if the bpf_create_map() error in the stress test is about ENOMEM, then we shouldn't fail hard via exit(), for all other cases we should however. So probably makes sense to just check for errno == ENOMEM in case of fd < 0 in test_hashmap_sizes() and then continue to keep trying under stress. Feel free to send a patch, Li. Thanks again, Daniel