From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-qv1-xf34.google.com (mail-qv1-xf34.google.com [IPv6:2607:f8b0:4864:20::f34]) by sourceware.org (Postfix) with ESMTPS id BE16D3858415 for ; Tue, 7 Sep 2021 12:05:12 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org BE16D3858415 Received: by mail-qv1-xf34.google.com with SMTP id 93so5600935qva.7 for ; Tue, 07 Sep 2021 05:05:12 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=osXcauWNQvznSGB60WIq/egLdv1JAoB+BOeD7+KR7oU=; b=TL9bsWXGi9dNCCA7smaFtsEK/IiEdH0uU64KCHLYycJN+DK7bIa99cfSy5gxZAthbq g98BR7vMgBexQ9DeC5ffi7VwKSthbbrlrhAC29UoNvbtgZo4oc7XIHhFuxZtzoyEk+gW 40115H0/udYLrH6sZvxZxIciAg2PJ6uAayhYP16DrMCPE3TkIVFt06Lu+kdxGkHXCMiz Nsgt+2NGCXVfcQ8/2ZFP4YGLdFCcUeq2unUP3UjN7BXluVfR1nK2RJ+cJVoEXPgSsi4N ed9uZNu6qFIaggw2WP1falHh7GoaNBS/Vxm5/dP5+A4/w+a+61XGGXKqWqXzbDce00gy g/sQ== X-Gm-Message-State: AOAM532O59xPCEUsf5uEwA2gMqhtWPDO133YbGFc5wvQc/JAzUl2gUxJ oOOY3hEUYUtffN3VDd7eA+BzHw== X-Google-Smtp-Source: ABdhPJxVKJGElwk8FITb2PNyCZdy6spGYIVaYSynxnas7azWfhZBZI3kw1fxAcE5xSze0BZBaQsZ4Q== X-Received: by 2002:a0c:e4c1:: with SMTP id g1mr16430332qvm.64.1631016312352; Tue, 07 Sep 2021 05:05:12 -0700 (PDT) Received: from ?IPv6:2804:431:c7cb:733d:f360:5bf3:9813:d8f5? ([2804:431:c7cb:733d:f360:5bf3:9813:d8f5]) by smtp.gmail.com with ESMTPSA id x8sm6795908qts.69.2021.09.07.05.05.11 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 07 Sep 2021 05:05:12 -0700 (PDT) Subject: Re: [PATCH 2/3] linux: Simplify get_nprocs To: Florian Weimer Cc: libc-alpha@sourceware.org, Nicolas Saenz Julienne References: <20210906181133.1401140-1-adhemerval.zanella@linaro.org> <20210906181133.1401140-3-adhemerval.zanella@linaro.org> <87mtoovijy.fsf@oldenburg.str.redhat.com> From: Adhemerval Zanella Message-ID: <83dd2d3f-e32b-b064-839c-a0796636a6ef@linaro.org> Date: Tue, 7 Sep 2021 09:05:10 -0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.13.0 MIME-Version: 1.0 In-Reply-To: <87mtoovijy.fsf@oldenburg.str.redhat.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, NICE_REPLY_A, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Sep 2021 12:05:13 -0000 On 07/09/2021 06:30, Florian Weimer wrote: > * Adhemerval Zanella: > >> + /* This cannot use malloc because it is used on malloc initialization. */ >> + enum { max_num_cpus = 32768 }; >> + size_t cpu_bits_size = CPU_ALLOC_SIZE (max_num_cpus); >> + __cpu_mask cpu_bits[cpu_bits_size / sizeof (__cpu_mask)]; > > I think cpu_bits_size should be an enum constant as well, to avoid > creating a VLA. Indeed, I will fix it.