From owner-svn-src-head@freebsd.org Thu Mar 24 15:01:58 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6D5F3ADB51C; Thu, 24 Mar 2016 15:01:58 +0000 (UTC) (envelope-from etnapierala@gmail.com) Received: from mail-wm0-x22b.google.com (mail-wm0-x22b.google.com [IPv6:2a00:1450:400c:c09::22b]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 08F8A1C07; Thu, 24 Mar 2016 15:01:58 +0000 (UTC) (envelope-from etnapierala@gmail.com) Received: by mail-wm0-x22b.google.com with SMTP id u125so16422313wmg.1; Thu, 24 Mar 2016 08:01:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:cc:subject:message-id:mail-followup-to :references:mime-version:content-disposition :content-transfer-encoding:in-reply-to:user-agent; bh=ZdJl+YOmzMFALvp2XuInUjKzdyuxpFsObKUHUcdG2+o=; b=HR0gp2IrEC2hhY+TKIthGMBQIP8Jn++17tvpUxWWRcQzOETwPCcsxGffJnp0TJfPuN PRnQwQi6kUY/qEGH3/c7j6GGA8B2/IKYqhHEkG3IAVkyYenVTiOJgvTX3/0lmsqOY1gT pmqvwX6NiD4I39Kf0qEwEpF/O8zpFD3k8+A/ZqFaUtMKdCZBsKGcFs3ZsgkHMQhOEVRj gC0fgLh360nhE7LvE254pkmvwnZbBZ5TmNtFZydcMgW3ljrd0gQGHhC5XXoKW73Qpcj2 zEwlscqwJ3aqSSdQnpebagxdS/Upqoj50gTQwDRNFXQV2qV/QSF2XpTXXK2mZPzlU0SP aNTw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :mail-followup-to:references:mime-version:content-disposition :content-transfer-encoding:in-reply-to:user-agent; bh=ZdJl+YOmzMFALvp2XuInUjKzdyuxpFsObKUHUcdG2+o=; b=GoQtbgtirewHfzKx7KpBSzhvkUeQz2mvRrnKrMTko7Y+GaokIbDTKXPMWCUzKN8yTK 3HdutVDNknkYQ41DJdALWPzyBmzydxv4nj0pQtVbdCNyCSbkFZsssKFF7i68the70uSi V84kTBykSK1NBtJch0KpeX2kMaVTPHuLJGypiZJuBUUcB/rVAbX9Vb7vSvuk5C7gmI6l MkLrt5pXIe2RFbiDqKD+2umB8QNMeWyvEUkuqkShJqDUHj8uH3zo6JMUDLLZdiWlYcDi mnPxDXftpdWU+jvs/qZ4vMzMJ+H5Y54pIPIWiSJT04QXnvjhnE+j9DCAR25kcb9I87J1 xnpw== X-Gm-Message-State: AD7BkJKvZmUryIguhXTHCVScrNDrvmz7OVfY+91YgI1dz8iHNzMP8gnWWgOhjX7RNwftnw== X-Received: by 10.194.222.234 with SMTP id qp10mr10315461wjc.138.1458831715245; Thu, 24 Mar 2016 08:01:55 -0700 (PDT) Received: from brick.home (etj156.neoplus.adsl.tpnet.pl. [83.20.155.156]) by smtp.gmail.com with ESMTPSA id u14sm27393399wmu.8.2016.03.24.08.01.53 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 24 Mar 2016 08:01:54 -0700 (PDT) Sender: =?UTF-8?Q?Edward_Tomasz_Napiera=C5=82a?= Date: Thu, 24 Mar 2016 16:01:51 +0100 From: Edward Tomasz =?utf-8?Q?Napiera=C5=82a?= To: Alexander Motin Cc: =?iso-8859-1?Q?Jean-S=E9bastien_P=E9dron?= , Ian Lepore , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r297190 - head/sys/kern Message-ID: <20160324150151.GA1277@brick.home> Mail-Followup-To: Alexander Motin , =?iso-8859-1?Q?Jean-S=E9bastien_P=E9dron?= , Ian Lepore , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201603221346.u2MDk1XH029623@repo.freebsd.org> <1458662141.1091.16.camel@freebsd.org> <56F29654.8030806@dumbbell.fr> <20160323174537.GA1826@brick.home> <56F3B441.6030602@dumbbell.fr> <20160324134222.GA1442@brick.home> <56F3F52F.9040705@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <56F3F52F.9040705@gmail.com> User-Agent: Mutt/1.5.24 (2015-08-30) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Mar 2016 15:01:58 -0000 On 0324T1609, Alexander Motin wrote: > On 24.03.16 15:42, Edward Tomasz Napierała wrote: > > On 0324T1032, Jean-Sébastien Pédron wrote: > >> On 23/03/2016 18:45, Edward Tomasz Napierala wrote: > >>>> So maybe callouts are disabled in this situation. If there is a way to > >>>> detect that, then vt(4) can go back to a "synchronous mode" where it > >>>> refreshes the screen after each typed character, like it does when ddb > >>>> is active. > >>> > >>> Looks like that's the case: for some reason the callouts don't work. > >>> This trivial hack is a (mostly) working workaround: > >>> > >>> Index: svn/head/sys/kern/kern_cons.c > >>> =================================================================== > >>> --- svn/head/sys/kern/kern_cons.c (revision 297210) > >>> +++ svn/head/sys/kern/kern_cons.c (working copy) > >>> @@ -430,6 +430,7 @@ cngets(char *cp, size_t size, int visible) > >>> lp = cp; > >>> end = cp + size - 1; > >>> for (;;) { > >>> + pause("meh", 1); > >> > >> Could you please explain how this works to me? Does calling pause() here > >> give a chance to interrupt handlers or other threads of running? > > > > It looks like it allows the callout to run. I've did an experiment > > and added a simple callout that printed something each second; during > > the root mount prompt it doesn't get run unless you type '.', which > > calls pause(9). > > Kernel threads run with absolute priorities, so if somehow this threads > happen to have higher or equal priority then callout thread, or the > kernel is built without PREEMPTION, then the last may never be executed > until this thread get to sleep or at least call sched_yield(). The callout's td_priority seems to be 40; the thread running the prompt is 84, so it's lower. I've just noticed another curious thing, though: when you press ScrLk, the screen gets immediately refreshed; also, pressing arrows works just the way it should. In other words, the refresh is broken except for the ScrlLk mode, where it works as it should.