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 X-Spam-Level: X-Spam-Status: No, score=-8.7 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 359DCC433EF for ; Wed, 22 Sep 2021 08:35:02 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id CDE16611B0 for ; Wed, 22 Sep 2021 08:35:01 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org CDE16611B0 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id 58BBC6B006C; Wed, 22 Sep 2021 04:35:01 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 5149D900003; Wed, 22 Sep 2021 04:35:01 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 3B5BE900002; Wed, 22 Sep 2021 04:35:01 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0079.hostedemail.com [216.40.44.79]) by kanga.kvack.org (Postfix) with ESMTP id 2BF166B006C for ; Wed, 22 Sep 2021 04:35:01 -0400 (EDT) Received: from smtpin23.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id E02C51802C53E for ; Wed, 22 Sep 2021 08:35:00 +0000 (UTC) X-FDA: 78614549160.23.BBC7674 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by imf04.hostedemail.com (Postfix) with ESMTP id 560EC50000B2 for ; Wed, 22 Sep 2021 08:35:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1632299699; 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=svaC5frr5Y1j2ok3e6TGBYwEyUBuVy40SZeCKDrTUZw=; b=Wh5F9lCpm6qS6hRx9mTIEOGkCWL0SQw/xEU8/4R1XEMHDEQm1AFAxpx25JsTHsEwUb6wR3 q5TrLBd2BjqdzX8lYzDD1gGDHXnAows7L5a+sk1y+TeqzBNc7bGVh/SV43nqS7k0BsgYD3 4v/KVjI6JznfuYngtUuSx4XrcjQJuXA= Received: from mail-wr1-f72.google.com (mail-wr1-f72.google.com [209.85.221.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-521-MqGbIhcNPImB6gvp5a1DQg-1; Wed, 22 Sep 2021 04:34:58 -0400 X-MC-Unique: MqGbIhcNPImB6gvp5a1DQg-1 Received: by mail-wr1-f72.google.com with SMTP id f11-20020adfc98b000000b0015fedc2a8d4so1503928wrh.0 for ; Wed, 22 Sep 2021 01:34:58 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:subject:to:cc:references:from:organization :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=svaC5frr5Y1j2ok3e6TGBYwEyUBuVy40SZeCKDrTUZw=; b=WF4XWbQ4DMcoQ0VkiVBcPcsTDzBJTFXQEQzbDhH+ObuxGorZEDPZeg475VBpNdWy2j ERnkZ9BoxPnfxwQTg+qVVG3eXoDlHQ+V6zVGD/O8qcq1MdVScjr21B6OU8OGMOAaCNQT T1PQmSgtdpxqLzrVxZkAO2z4fGsQoB9nZ5LTs3JVGHDwC4QigjTOVBv2TK0SX4boHp8V 08Hf53jfKMxXnYfC7BLVM6/4uRDdwuIn95cs+LN7OP0Mn+ZSdAh33Lykr9f2MUa2b9Xu YE9ipgMouGbXeJ2asH2x9cf2Z7Jmbg/yPkpfYXenRfui/WPCktMvYpnn5lxWiDG4+Aq+ B4CQ== X-Gm-Message-State: AOAM533hB45OZJZJAldB05SCZdsdtk6cnGGAaC9ZD2LJaaJXWmjvoSTw yLgDE6HpH5NzEJJ+Nn8ILvihUEEEPeUVj3T9GEHeHrBdc02koNOPEz9/VUxTPBFwkxs17n3NXmD UmQ8W0eIooq7lP1pUAYq7e5EWEw148Bmfx0uIGhQXr3ktLxeH1HsgQYtD7aw= X-Received: by 2002:a5d:5241:: with SMTP id k1mr8792551wrc.227.1632299697497; Wed, 22 Sep 2021 01:34:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxbVJ4dzB/vx3MdrtneE17zvVD/pt2Uv3PVLT5B48w60IgoAph1QLkJ0nxtjwF+V/kcbPNs1A== X-Received: by 2002:a5d:5241:: with SMTP id k1mr8792508wrc.227.1632299697175; Wed, 22 Sep 2021 01:34:57 -0700 (PDT) Received: from [192.168.3.132] (p5b0c64dd.dip0.t-ipconnect.de. [91.12.100.221]) by smtp.gmail.com with ESMTPSA id p5sm1658663wrd.25.2021.09.22.01.34.56 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 22 Sep 2021 01:34:56 -0700 (PDT) Subject: Re: [PATCH v1] mm/vmalloc: fix exact allocations with an alignment > 1 To: Uladzislau Rezki Cc: LKML , Ping Fang , Andrew Morton , Roman Gushchin , Michal Hocko , Oscar Salvador , Linux Memory Management List References: <20210908132727.16165-1-david@redhat.com> <20210916193403.GA1940@pc638.lan> <221e38c1-4b8a-8608-455a-6bde544adaf0@redhat.com> <20210921221337.GA60191@pc638.lan> From: David Hildenbrand Organization: Red Hat Message-ID: <7f62d710-ca85-7d33-332a-25ff88b5452f@redhat.com> Date: Wed, 22 Sep 2021 10:34:55 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: <20210921221337.GA60191@pc638.lan> X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Authentication-Results: imf04.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=Wh5F9lCp; spf=none (imf04.hostedemail.com: domain of david@redhat.com has no SPF policy when checking 216.205.24.124) smtp.mailfrom=david@redhat.com; dmarc=pass (policy=none) header.from=redhat.com X-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: 560EC50000B2 X-Stat-Signature: kgcgkuep6cramsshc96uy1ybyytqh5tp X-HE-Tag: 1632299700-470502 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000057, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: >> No, that's leaking implementation details to the caller. And no, increasing >> the range and eventually allocating something bigger (e.g., placing a huge >> page where it might not have been possible) is not acceptable for KASAN. >> >> If you're terribly unhappy with this patch, > Sorry to say but it simple does not make sense. > Let's agree to disagree. find_vmap_lowest_match() is imprecise now and that's an issue for exact allocations. We can either make it fully precise again (eventually degrading allocation performance) or just special-case exact allocations to fix the regression. I decided to go the easy path and do the latter; I do agree that making find_vmap_lowest_match() fully precise again might be preferred -- we could have other allocations failing right now although there are still suitable holes. I briefly thought about performing the search in find_vmap_lowest_match() twice. First, start the search without an extended range, and fallback to the extended range if that search fails. Unfortunately, I think that still won't make the function completely precise due to the way we might miss searching some suitable subtrees. >> >> please suggest something reasonable to fix exact allocations: >> a) Fixes the KASAN use case. >> b) Allows for automatic placement of huge pages for exact allocations. >> c) Doesn't leak implementation details into the caller. >> > I am looking at it. Thanks! -- Thanks, David / dhildenb