Received: by 2002:ac0:98c7:0:0:0:0:0 with SMTP id g7-v6csp3897250imd; Mon, 29 Oct 2018 14:12:39 -0700 (PDT) X-Google-Smtp-Source: AJdET5eNacWvNG/tYmDZwPUgQzmRHEHNAq9NdjDRRvDqB1pFaESc4ml0Hh3JtyUhuBZcEK+loDTk X-Received: by 2002:a63:a441:: with SMTP id c1-v6mr15415722pgp.49.1540847559914; Mon, 29 Oct 2018 14:12:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1540847559; cv=none; d=google.com; s=arc-20160816; b=QXwc+xsuMGsx5ps3klaC0mGZSVWLBF0NfHvZ7aZy8er8pZ2/nfLmRtlTW9367c5s43 f8R5kHXvXvPGLYWa2N52bph7sSsA3zIReYokvf2S6CAn0isbecpEqXu9IQu7aS3CcT4T hdTaPrkDEJLh8ZXwe3/aJJD22qliRZqVVje3AfObxfNLqjVqoFxGnjlcQk7+Tu6mM/dd 3oHblnWZVoYb5xGNgJtmmoqbYyUgYEL85AtPlj4a0AtaG+UHEX20lR6H25fpJXYlpYCS kyhMFsohKc/u34w39wxtRk9qY4ByAiUM7mjaQ8OZ/j18zsZnzhiG3x+rNEEidG1V9WQI 4icw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=pXJ9v5cNmnvrVzHocIF6v4kXOg7XbDEkZHv+I+2MwJA=; b=Sz33WBIaTejwKh0ofIrXUl4EHdj2VJO+jZRlOk+sF8bHEtYUN/aprMN4Y2OgPIgXRX T8KsBDKFf+IELgq1giYCjG3BW0pPi5lPBRNg/tT8gzLXMZwELsNbetHc+iXjVY75Zh93 XKfBWYFi81DBrKW4ItpQpw/21A7alBYQF+ux7ud1GwfR+uFN0Mdr9vhSB0NfQ7Yz2bx4 l6E8iFGQTVz6LxLzlykj3zZX6ymfTS9/cVKdxg9kJmciLKiS/7uTkjGc9KS/t61PayMy gx6rZObWBq/8PPhQ0d4KaznjUU6MivqBqg4Op/VsJFTUc5A8pbNLetDMrjqin4rygN+a jrmA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=O3RZjlLW; 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 s144-v6si9946233pfc.149.2018.10.29.14.12.22; Mon, 29 Oct 2018 14:12:39 -0700 (PDT) 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; dkim=pass header.i=@linux-foundation.org header.s=google header.b=O3RZjlLW; 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 S1727111AbeJ3GCZ (ORCPT + 99 others); Tue, 30 Oct 2018 02:02:25 -0400 Received: from mail-lj1-f182.google.com ([209.85.208.182]:42820 "EHLO mail-lj1-f182.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726016AbeJ3GCY (ORCPT ); Tue, 30 Oct 2018 02:02:24 -0400 Received: by mail-lj1-f182.google.com with SMTP id f3-v6so9280324ljk.9 for ; Mon, 29 Oct 2018 14:11:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=pXJ9v5cNmnvrVzHocIF6v4kXOg7XbDEkZHv+I+2MwJA=; b=O3RZjlLW5BT2l9xx2REH1tgivRw7i21l3OcJ9+VQ4GTAS3pTnJ4CzBBk9JjFTgTrBM KvpN1rnQ9lE8aMknIQGLO7gSO/6t9zGI2473MuNwyigxNGdS2O89SV37CTnqfMnFGnrb gpX+l5caNoDPrM8E6gweXcV3J6tDS1uMEeyYc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=pXJ9v5cNmnvrVzHocIF6v4kXOg7XbDEkZHv+I+2MwJA=; b=YilV72gfHJdDX9kt/vSG9dJAyYkcmikGTQ/b/lyvS8KLmF/IM765SFhth511ruu8tK glQd4IGZa7GhXGYV0FFposnYVOUt1ZMU6lyxYXz4ioCNFpqy1I+qsml7UzZ09wDrdUQX AuBT4TfslQm0pw+AWE+z1zz5zMXop6f4rEZwOHVX5lfsiIIPnQgN9eVNVNjKV+ZP+bcu dWaOKajxt0KcON68BmIvZnW52wmKXHyxyfx7TJD6Yg7CmIQMwVZvHAxgfMCtu6uTHcLI eeKjH2pKx2f2kT3wALWifvoxd+0sLu1fDXjxBEaLQzKW4uASni7YDHVoh9pRQm4PLq6I JSmQ== X-Gm-Message-State: AGRZ1gI+RBPqT0eUw19upBAvjWPLM4G2+hBG6yH+s91xgJDSVX1Fy5O8 LiLvvFLFrMn/V0fHDfhpEgBcg9wVb4jl5w== X-Received: by 2002:a2e:59ca:: with SMTP id g71-v6mr9947510ljf.79.1540847516838; Mon, 29 Oct 2018 14:11:56 -0700 (PDT) Received: from mail-lf1-f54.google.com (mail-lf1-f54.google.com. [209.85.167.54]) by smtp.gmail.com with ESMTPSA id q5-v6sm3244120lfj.85.2018.10.29.14.11.55 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 29 Oct 2018 14:11:56 -0700 (PDT) Received: by mail-lf1-f54.google.com with SMTP id c16so7207970lfj.8 for ; Mon, 29 Oct 2018 14:11:55 -0700 (PDT) X-Received: by 2002:ac2:41d8:: with SMTP id d24-v6mr197857lfi.138.1540847515262; Mon, 29 Oct 2018 14:11:55 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Linus Torvalds Date: Mon, 29 Oct 2018 14:11:36 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: Logitech high-resolution scrolling.. To: Harry Cutts Cc: Jiri Kosina , Benjamin Tissoires , linux-input@vger.kernel.org, Linux Kernel Mailing List , peter.hutterer@who-t.net Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Oct 29, 2018 at 12:17 PM Harry Cutts wrote: > > I don't really understand why the half-multiplier thing would cause > the instability; there's still a low-res threshold every 8 high-res > units whichever way you do it No there isn't. So what the half-multiplier did, assuming a multiplier of 8 (which is what my MX Anywhere 2S reports) would be: - remainder starts at 3 - high-res is +1 - now remainder is 3+1, and it triggers the >= half logic - 4/8 is 0, but then the code added 1 because high-res was positive, so the code decides to add 1 - the code does a wheel update of 1, and updates remainder with -8, so now it's -4 Next time around, if the high-res update is 0 or -1, it will go the other direction. And then it will oscillate. Notice how tiny movements of +1/-1 in the *high-res* count can translate into +1/-1 in the regular wheel movement. And those tiny movements very definitely happen. Maybe it's just my mouse, but the undeniable fact is that the old algorithm was simply not stable. It was literally unusable. I had to be careful not to even touch the wheel at all, or it would scroll randomly. I do not believe that you actually ever *used* that code, or if you did, you only did so with applications that were high-res aware and ignored the regular wheel entirely because you were testing in an environment with other changes than just the kernel. Linus