Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp2010020rwr; Fri, 21 Apr 2023 02:59:31 -0700 (PDT) X-Google-Smtp-Source: AKy350bNMEhgQX48hAY1Afd8U4XHGNAk7A/ZrHBYGP7te8CRjXwwEqsNifaSnuoETDQzCfT0yfrB X-Received: by 2002:a05:6a20:7346:b0:ee:fe67:5cb9 with SMTP id v6-20020a056a20734600b000eefe675cb9mr6212955pzc.17.1682071171100; Fri, 21 Apr 2023 02:59:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682071171; cv=none; d=google.com; s=arc-20160816; b=HafA6sdKcVzpgIr/c+hc7AsnXK2eKwGTkbCSeuQmVOLh3RNAh2/N8a/o20g0+ifqu/ Yt8gfAWLSG1sO4rB9mV+92ZITJ3W6zb/IR9jEf1+q87JB7BT8hApGSrPl0nH7663xFko omEMqCNv81vs2FDpkAhvEJ56EWZcKo+g9o7fjJzHLKT03pf1wy70xiAWJ042wCAmNacU guwe+NJkeDYaeVNIrnQ96eIrnWRg1kiqs9E6O07lA/se1opEIjKL9czAS0K2fOc2Bhdw h1uexwf64cjXXRO/EJa9bQfX8wJphBtFcNHUKsjOj3Mekn2NtcLu+wNtIIGZefATXozc Kedg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:subject :from:references:cc:to:content-language:user-agent:mime-version:date :message-id:dkim-signature; bh=Gw3Z1UuYa8vwz13PltM2dk9xXXE2d3syosEDMNs/io0=; b=ZuKfi9txKoEbUtaYCw/UwWeG6BVlf8X3ykAnUq2rRvSj8i/+lQSvVrlOef63grVeri ZjydYmhX9c35BmC/1h9TTvrCHV0nKcumcCd1QHQngOvMC9RlghUqG5lTIfQ7sd2spkEI Sh63N5Anc5fesGijAy09DWObAGWYYz20548q2HJWL1sEr//ECpZoSFVHU8j1Z6K/FUb7 CE9vJ3g3pXBk1mmG4XSh+I5tBH2yf4Q+U0rir4r1QOeKiUvtoyHXRdpbTVFGR9SX8C7C TYVMsCOHVKq9/4V0dzfy1fv2o3ywNuZPqSTw11imdcDoin9b34Z51MhSyO09vwZknMZP CVuA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@nbd.name header.s=20160729 header.b="CZH0L+/w"; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nbd.name Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id o2-20020a634102000000b00524a262e0dbsi4155388pga.738.2023.04.21.02.59.21; Fri, 21 Apr 2023 02:59:31 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=fail header.i=@nbd.name header.s=20160729 header.b="CZH0L+/w"; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nbd.name Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230025AbjDUJxN (ORCPT + 62 others); Fri, 21 Apr 2023 05:53:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59656 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229520AbjDUJxM (ORCPT ); Fri, 21 Apr 2023 05:53:12 -0400 Received: from nbd.name (nbd.name [46.4.11.11]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DE99D9772 for ; Fri, 21 Apr 2023 02:53:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=nbd.name; s=20160729; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:Subject:From :References:Cc:To:MIME-Version:Date:Message-ID:Sender:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=Gw3Z1UuYa8vwz13PltM2dk9xXXE2d3syosEDMNs/io0=; b=CZH0L+/w1NHl/Z7+jNpeJZznRD ji8wMh3zvlboLCZ9tARmUA2YUlK+KL7R7+CqujJQR19uFynpF4Vz/QhvmO/vx6eGtUaBlDpAzp+ge ufNFmLiu8X9SZY/gA5gwHZyxjNPlyUAT2TIPQfED0qyCXXHazEFddgQwJL0fpQwlg3YY=; Received: from p54ae9730.dip0.t-ipconnect.de ([84.174.151.48] helo=nf.local) by ds12 with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1ppnRz-00H7Bc-4L; Fri, 21 Apr 2023 11:53:07 +0200 Message-ID: Date: Fri, 21 Apr 2023 11:53:06 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.10.0 Content-Language: en-US To: Johannes Berg , Benjamin Beichler Cc: Karthik M , linux-wireless@vger.kernel.org, Tamizh Chelvam Raja References: <4f0efc62-0ca5-fe85-fdd8-9beca7ff94d7@uni-rostock.de> <04A41274-08B2-4473-AFD0-7D91D3850F4B@nbd.name> From: Felix Fietkau Subject: Re: [PATCH v1] wifi: mac80211: Initialize EWMA fail avg to 1 In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-5.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,SPF_HELO_NONE, SPF_NONE,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org On 21.04.23 11:35, Johannes Berg wrote: > To me, the first question is if there are potentially any users that are > _relying_ on the current behaviour. This seems unlikely though, looking > at the ~30 users, most sound like signal/rssi, packet sizes, etc. > > So let's say with the bug found here that prompted this patch, chances > are that there aren't any users that really want 0 to be special. I also > can't even really think of a reason for wanting that. > > > So then let's say we want to fix the existing code. I can think of these > possible ways: > > * splitting off a bit for initialized from the unsigned long > (which at least for 64-bit should be OK since presumably most code > using this will run on 32-bit systems too) > * adding another value for it, e.g. making it u32 and adding a bool for > "first value" > * biasing the value, like Felix proposes, could be by 1 or -1 for > example > > All of these have a memory cost, of course, though the first two are > data and the second code, so for things like stations the code exists > only once and the data multiple times. On 64-bit we can probably make > the first two not have a data memory cost though. > > As for biasing the value, couldn't that lead to a similar problem? It's > clearly less likely that the end of the range is reached rather than > zero, but still? I don't see how it can reduce the range in any way, since the bias is added to the fractional part. A range reduction would seem to imply having an average value that's bigger than the maximum allowed shifted input (top bits cut off), and I don't think that's possible. - Felix