From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34925) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V1tuo-00043r-WF for qemu-devel@nongnu.org; Wed, 24 Jul 2013 03:55:19 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1V1tun-0008MF-Si for qemu-devel@nongnu.org; Wed, 24 Jul 2013 03:55:18 -0400 Received: from mail-yh0-x22d.google.com ([2607:f8b0:4002:c01::22d]:38028) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V1tun-0008Lu-NG for qemu-devel@nongnu.org; Wed, 24 Jul 2013 03:55:17 -0400 Received: by mail-yh0-f45.google.com with SMTP id i72so27812yha.4 for ; Wed, 24 Jul 2013 00:55:16 -0700 (PDT) Sender: Paolo Bonzini Message-ID: <51EF8851.4040209@redhat.com> Date: Wed, 24 Jul 2013 09:54:57 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: <1374396185-10870-1-git-send-email-pingfank@linux.vnet.ibm.com> <429B80A9A0DBF7FBF05E7C5A@nimrod.local> <628DFBF37B094813C72B6DBF@Ximines.local> <51EE5B34.10507@redhat.com> <51EF7752.9020505@redhat.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [RFC 0/8] arm AioContext with its own timer stuff List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: liu ping fan Cc: Kevin Wolf , Alex Bligh , Jan Kiszka , Stefan Hajnoczi , qemu-devel@nongnu.org, Anthony Liguori Il 24/07/2013 09:43, liu ping fan ha scritto: > Paid some time to dig the kernel code, and find out that the > resolution lost by timeout of poll/select..etc is cause by the timeout > is a slack region. > See code in > do_poll() > if (!poll_schedule_timeout(wait, TASK_INTERRUPTIBLE, to, slack)) > > Notice the slack param, it causes the lose of resolution. > The process default slack time inherits from init_task and it is > .timer_slack_ns = 50000, /* 50 usec default slack */ > But we can fix it by PR_SET_TIMERSLACK to decrease it for select/poll/... Right, good catch. I just learnt about PR_SET_TIMERSLACK. :) Alex, can you add it to your series? (Note that you must set a timer slack of 1, because 0 is interpreted as "default"). > So ppoll with timerslack adjustment will meet our requirement. But > what about other non-linux system? They might have their own mechanism similar to PR_SET_TIMERSLACK. Paolo