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 7EAB9C433FE for ; Mon, 10 Oct 2022 06:57:03 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id B25656B0071; Mon, 10 Oct 2022 02:57:02 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id AD5666B0073; Mon, 10 Oct 2022 02:57:02 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 974B26B0074; Mon, 10 Oct 2022 02:57:02 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 849B86B0071 for ; Mon, 10 Oct 2022 02:57:02 -0400 (EDT) Received: from smtpin13.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 5A16F1601F4 for ; Mon, 10 Oct 2022 06:57:02 +0000 (UTC) X-FDA: 80004132684.13.3FCE839 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf10.hostedemail.com (Postfix) with ESMTP id A0026C001C for ; Mon, 10 Oct 2022 06:57:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1665385021; 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=CTvlZ2UrEc/zYG0ArHPKFycK6DF3ayFdpzEumNdnUnQ=; b=OWIE3Qq4sMHrd+dzYayRwnYRMBn7XfHzKukJtRquWlXqmNUR1ovskDmrQ5kzY7CKTYWhjH FRH1PSFJSMjgNYVQF+tk+FeleauMpFK2pZMQThBIAp5PNMZoKP1mkdoadGLDpksotnnkSU gHCgxaiw+6PJdIXOJsZBl7M1LGq87Yw= Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-638--ID8gMBPMzSKzyCXJD6qTQ-1; Mon, 10 Oct 2022 02:56:57 -0400 X-MC-Unique: -ID8gMBPMzSKzyCXJD6qTQ-1 Received: by mail-wm1-f70.google.com with SMTP id b7-20020a05600c4e0700b003bde2d860d1so6569995wmq.8 for ; Sun, 09 Oct 2022 23:56:57 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:organization:from:references :cc:to:content-language:subject:user-agent:mime-version:date :message-id:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=CTvlZ2UrEc/zYG0ArHPKFycK6DF3ayFdpzEumNdnUnQ=; b=vfYPI5iINu5UoT8DqcG6UbJIrgKLCHWUCj79gmcLFLw8e3jEKJGO8q4NnO6Xwfo5IS bdl9n9UM1kC4Vyy5MeLfMoJsmxMb7NOZDq6c7YDL7ih/C5wm7dcLLl8B630pLQwXVJWD 0CYByo9SfoivBMispznP91CuT/mdR235cpdIKTPHEAdUw6H0pgMMGT5/8GEQ9MejR7SP ySDDck4oeFVbO+/DvOQCdbmq3IS7anavKC2f9MCdIqd8Tn3QmkpPIfIKvyalFRZwVaPr NJPWWQKcSmozK0z35Ar/tXWd5mUJ3fZXdoX3hsl6AS7RQBZzfewVUx+P3WOtwcMXQarQ Jthg== X-Gm-Message-State: ACrzQf0tcLmbqtuV+Hu6eldFviXyfRg+i9MHXXf9lfmveYw5dhqQaC4L fvy//yxt+hObalhzlgiqiq/DRgFzLGUwYWpbxmffOSNsfB5GD/8xhV9JEX54uGX9BMn1GBzQAA9 MXS9eRPCWMJ8= X-Received: by 2002:a05:600c:a4c:b0:3b4:fc1b:81 with SMTP id c12-20020a05600c0a4c00b003b4fc1b0081mr11244047wmq.125.1665385016786; Sun, 09 Oct 2022 23:56:56 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6PdlsQJf2hEK9kUtpQ/cdA17BbF1ZqcIIIaIherXbSqeE2FO7JwQAlzedtxoLfNmbNO4gbyg== X-Received: by 2002:a05:600c:a4c:b0:3b4:fc1b:81 with SMTP id c12-20020a05600c0a4c00b003b4fc1b0081mr11244039wmq.125.1665385016554; Sun, 09 Oct 2022 23:56:56 -0700 (PDT) Received: from ?IPV6:2003:cb:c704:e600:3a4a:f000:b085:4839? (p200300cbc704e6003a4af000b0854839.dip0.t-ipconnect.de. [2003:cb:c704:e600:3a4a:f000:b085:4839]) by smtp.gmail.com with ESMTPSA id q14-20020a05600000ce00b0022584c82c80sm8021349wrx.19.2022.10.09.23.56.55 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 09 Oct 2022 23:56:56 -0700 (PDT) Message-ID: <6d75325f-a630-5ae3-5162-65f5bb51caf7@redhat.com> Date: Mon, 10 Oct 2022 08:56:55 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.3.1 Subject: Re: KASAN-related VMAP allocation errors in debug kernels with many logical CPUS To: Uladzislau Rezki Cc: Alexander Potapenko , Andrey Konovalov , "linux-mm@kvack.org" , Andrey Ryabinin , Dmitry Vyukov , Vincenzo Frascino , kasan-dev@googlegroups.com References: <8aaaeec8-14a1-cdc4-4c77-4878f4979f3e@redhat.com> <9ce8a3a3-8305-31a4-a097-3719861c234e@redhat.com> From: David Hildenbrand Organization: Red Hat In-Reply-To: X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1665385021; a=rsa-sha256; cv=none; b=DztfvCyrA8hEPbMu+4R1hC0QCkHM6j7ed6aQqEYvV7LVdao0gg0/iRWq78PfDoCvuc1PGe ej+gPSnmxBosEIhGGZK5AIFevrpn7/7VJemLLxh9qgihznyVac8PmLz+fIXnkwy6NkTcm4 iUuAjr8QFxYUOnSdnXmoQnESMyJBKvI= ARC-Authentication-Results: i=1; imf10.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=OWIE3Qq4; dmarc=pass (policy=none) header.from=redhat.com; spf=pass (imf10.hostedemail.com: domain of david@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=david@redhat.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1665385021; h=from:from:sender: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:dkim-signature; bh=CTvlZ2UrEc/zYG0ArHPKFycK6DF3ayFdpzEumNdnUnQ=; b=4tDLdbT6+43yDlgq2PKWVNSrUHIrQo9bA9tTZJ7u2ITPV9bPo6zdkv+sdM+KcU1TKdetta p/HCndW44FzqLbVBkOG0ssdIit+6qt1ICSx2xLtu2Ks7f9HaB9Ov4ka+wTJVJrbGlndwa7 sMwnZKHgwS1/7UP4rkJN66Gt1jPA4RY= X-Stat-Signature: 6bjsz7rx714gtxzhty7kzno38ge5hnxc X-Rspamd-Queue-Id: A0026C001C Authentication-Results: imf10.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=OWIE3Qq4; dmarc=pass (policy=none) header.from=redhat.com; spf=pass (imf10.hostedemail.com: domain of david@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=david@redhat.com X-Rspam-User: X-Rspamd-Server: rspam03 X-HE-Tag: 1665385021-502780 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: >>> Maybe try to increase the module-section size to see if it solves the >>> problem. >> >> What would be the easiest way to do that? >> > Sorry for late answer. I was trying to reproduce it on my box. What i > did was trying to load all modules in my system with KASAN_INLINE option: > Thanks! > > #!/bin/bash > > # Exclude test_vmalloc.ko > MODULES_LIST=(`find /lib/modules/$(uname -r) -type f \ > \( -iname "*.ko" -not -iname "test_vmalloc*" \) | awk -F"/" '{print $NF}' | sed 's/.ko//'`) > > function moduleExist(){ > MODULE="$1" > if lsmod | grep "$MODULE" &> /dev/null ; then > return 0 > else > return 1 > fi > } > > i=0 > > for module_name in ${MODULES_LIST[@]}; do > sudo modprobe $module_name > > if moduleExist ${module_name}; then > ((i=i+1)) > echo "Successfully loaded $module_name counter $i" > fi > done > > > as you wrote it looks like it is not easy to reproduce. So i do not see > any vmap related errors. Yeah, it's quite mystery and only seems to trigger on these systems with a lot of CPUs. > > Returning back to the question. I think you could increase the MODULES_END > address and shift the FIXADDR_START little forward. See the dump_pagetables.c > But it might be they are pretty compact and located in the end. So i am not > sure if there is a room there. That's what I was afraid of :) > > Second. It would be good to understand if vmap only fails on allocating for a > module: > > > diff --git a/mm/vmalloc.c b/mm/vmalloc.c > index dd6cdb201195..53026fdda224 100644 > --- a/mm/vmalloc.c > +++ b/mm/vmalloc.c > @@ -1614,6 +1614,8 @@ static struct vmap_area *alloc_vmap_area(unsigned long size, > va->va_end = addr + size; > va->vm = NULL; > > + trace_printk("-> alloc %lu size, align: %lu, vstart: %lu, vend: %lu\n", size, align, vstart, vend); > + > spin_lock(&vmap_area_lock); > I'll try grabbing a suitable system again and add some more debugging output. Might take a while, unfortunately. -- Thanks, David / dhildenb