From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Lin Sun Newsgroups: gmane.emacs.bugs Subject: bug#73855: [PATCH] * lisp/autorevert.el: Avoid reverting buffer in short time Date: Sat, 19 Oct 2024 05:58:14 +0000 Message-ID: References: <871q0dx31n.fsf@gmx.de> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="16662"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 73855@debbugs.gnu.org To: Michael Albinus Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Oct 19 07:59:59 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1t22VL-0004AW-8T for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 19 Oct 2024 07:59:59 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t22V4-0000ZD-B2; Sat, 19 Oct 2024 01:59:42 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1t22V2-0000Z0-AU for bug-gnu-emacs@gnu.org; Sat, 19 Oct 2024 01:59:40 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1t22V2-0002gd-2E for bug-gnu-emacs@gnu.org; Sat, 19 Oct 2024 01:59:40 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=Date:From:In-Reply-To:References:MIME-Version:To:Subject; bh=oxcYEWSv7qp6YMPgdUaxurXofzSSLOPcTwM0uMMGj0A=; b=AjH5xJt3g263xKGEuS5fhfBxcbYMVd8U//NmmietGegcnaV51cy14QSdlTlzlnU3HvnnYWWJw5TqwOGLBjASwX5a0LGfZW1eeu+ub8lz+in74CdE+H5+3ZSYnRmEQoi8vd8yQ2J0hbNC7DHP9SGFms7rk4a6Ryvemted5AQPd4yLDHtCkSiYZJlnsLupfLvBXd36u7ESNW5OYLdi3pdwvq2T300X/+J7Qt3BMTZJ6puMyxheJLTRO/ndseYvT+9xKF0R3s4XW/XvlWvLeaqC3EWXj0XGN4GSRSygjtWcGQue7ZH+yXzRdcUckktknP8M1TyJypZbGp7UNyzqxVQMQA==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1t22VP-0003wk-0i for bug-gnu-emacs@gnu.org; Sat, 19 Oct 2024 02:00:03 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Lin Sun Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 19 Oct 2024 06:00:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 73855 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 73855-submit@debbugs.gnu.org id=B73855.172931759815131 (code B ref 73855); Sat, 19 Oct 2024 06:00:02 +0000 Original-Received: (at 73855) by debbugs.gnu.org; 19 Oct 2024 05:59:58 +0000 Original-Received: from localhost ([127.0.0.1]:40977 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t22VJ-0003vy-QB for submit@debbugs.gnu.org; Sat, 19 Oct 2024 01:59:58 -0400 Original-Received: from mail-ed1-f51.google.com ([209.85.208.51]:53732) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t22VH-0003va-FP for 73855@debbugs.gnu.org; Sat, 19 Oct 2024 01:59:56 -0400 Original-Received: by mail-ed1-f51.google.com with SMTP id 4fb4d7f45d1cf-5c94a7239cfso1338678a12.3 for <73855@debbugs.gnu.org>; Fri, 18 Oct 2024 22:59:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1729317506; x=1729922306; darn=debbugs.gnu.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=oxcYEWSv7qp6YMPgdUaxurXofzSSLOPcTwM0uMMGj0A=; b=dtIXrb7gEfbHVJBr4pXtXDfPl5Pm2WV3N1GGb4JNB3BjIwKWqBMaNZmj2hp+QPQsSA j0z7fuAsSF0RljQz7/2Wadh2g4tPHRTYWVL6w4CsTxXAwMvWnq+Ma/PQq3K1zG74gqW2 ivuiOG2vjY7Ev2NOXkHiN7/ior8UNp2WwY3quzvaS22IRmmVEiY7BqIcTzLXmpSX+PHD OgCqtHOwVbfHA+nRp9UAqteSN5f7+LV9Bb91YEP+HjfQgfKUmA8jcoXq9wavyME2Laq9 Aj45fCxiB90WoVikKM5GmMPPBzh+HKT1T5DzLzGSwfxHvpp75L89l56ThHcy/wLgCdi7 IM/Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729317506; x=1729922306; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=oxcYEWSv7qp6YMPgdUaxurXofzSSLOPcTwM0uMMGj0A=; b=lM5oYa08V0Cnil+p7lvcAAeeiwTPA2rZydPOjn6heVpRR+IHHNY51D3h+hyVdBVgrI KcQZapwSz9A6A/l/tiGhfavF7WFcdpw29fzsPnAlh0IKrKZcpCmuECY4ZvMoUcaLcXCf eeNkElpN3uaq21B4HuRVpX9nsiaNbbTF3JxV4noEsINXjNRm2gnbJZo4jI017fIqiltO NNpyLMjNx6QFXASE+ARrc4KYwJXtaxFcrEESQpx0hhZwb/DUZaswb17iDsT/SVAjudyw 5cxsyzCrqsEAi9qsWPOaPIVVatZZqwSlyDXOZ8fb0kyK3C6ntKQgN3To7k9ytA2XAVuZ 03nw== X-Gm-Message-State: AOJu0Yy5ewl6CvDThXCzw6BsUwqIllJK4I0TShmWqkKLnL9fMtdiHlLT 8dI7A++Abg6ibXUyu9bdeFiw9PLULudFbJt11jKkc65EEa7E0El53dkveZu5mLVfgFpbt0rAIXX /Z5U0ChG7BngQOM4Ywo18BjzfI/M= X-Google-Smtp-Source: AGHT+IGqts6B+GMfVeC3fVj9v0noGRASpFZCn+EAoZOYMg032Qp78awqewbSspKKSyRSbtiDzv5sQeeO9npioGZR0KI= X-Received: by 2002:a05:6402:2747:b0:5c9:4b8c:b92e with SMTP id 4fb4d7f45d1cf-5ca0ae814bbmr4998496a12.26.1729317505894; Fri, 18 Oct 2024 22:58:25 -0700 (PDT) In-Reply-To: <871q0dx31n.fsf@gmx.de> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:293829 Archived-At: On Fri, Oct 18, 2024 at 7:50=E2=80=AFAM Michael Albinus wrote: > > In your case, where mass write happens to a file, I recommend to set > auto-revert-use-notify to nil. Polling is used then instead, with > auto-revert-interval interval between reverts. The default value is 5 > (seconds), you might change it to 1. > > Furthermore, your use case doesn't look ideal for enabling > auto-revert-mode. Checking fast changing log files is better done with > auto-revert-tail-mode. > Thanks for the comments, the tail mode worked for me; but actually I enabled the global-auto-revert-mode, I have to manually switch to tail mode for some buffers. And yes, the default interval value is 5 seconds. Let's look at this case: the auto-revert-interval is 5, a writing happened 1 write / second, total 20 writings (in 20 seconds). The revert-handler run on: first time (T0), and then locks for 5 seconds; then T5 lock done, revert the buffer; then T6 reverts the and locks it again... The revert happened as below: T0...T5,T6...T11,T12...T17,T18...T23 The T5,T6 are nearby, similar happened on T11,T12, and after each lock end, there is a revert executed nearby. This patch try to enhance the lock, then makes the revert happened on: T0...T5...T10...T15... That reduced loading on my local. Best Regards, Lin