From owner-freebsd-arch@FreeBSD.ORG Sun Jan 4 18:58:56 2015 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7C6E6FD; Sun, 4 Jan 2015 18:58:56 +0000 (UTC) Received: from mail-we0-x22b.google.com (mail-we0-x22b.google.com [IPv6:2a00:1450:400c:c03::22b]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0D718BC5; Sun, 4 Jan 2015 18:58:56 +0000 (UTC) Received: by mail-we0-f171.google.com with SMTP id u56so6828619wes.2; Sun, 04 Jan 2015 10:58:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=lj6uNzZ5qyAiIDb22ODPg/1yflQdnaoZogrV9T//nDs=; b=p8rn4vJ0Yt9kiRQdfWpELDgollVxo2UdLbIU0MmpiRcAyzf65gIDPd/Sj9istgVqoP Bd3tHFrTk9W38/eaw4sTmCZTu0dR03UwgMUMiGtNe4w5j9qr4TM6I/Dg/pRa16D3Z6Ou +LwWCKhuWIZFb+D9DDzCYpPh6TtmxSlId9A/Xe7PS2KfVVAaT94SP9IzSP/uDr4I1voZ u6wsHu1p06dv7rlgtyEK7lzgkNNQiRW3b3Y1czrHongybP0ReDeerLPb9bZYcfK19NUF 8IW+geFCBdYngxbEoFuLL5PwIyXCKS7EpTbBKyL4D4cfIb3e1zlbKf/O7MNmS+XblT8E 2sLw== MIME-Version: 1.0 X-Received: by 10.194.5.37 with SMTP id p5mr50584701wjp.20.1420397934515; Sun, 04 Jan 2015 10:58:54 -0800 (PST) Sender: adrian.chadd@gmail.com Received: by 10.216.41.136 with HTTP; Sun, 4 Jan 2015 10:58:54 -0800 (PST) In-Reply-To: <54A92ED1.2070906@selasky.org> References: <54A1B38C.1000709@selasky.org> <20150101005613.4f788b0c@nonamehost.local> <54A49CA5.2060801@selasky.org> <54A4A002.8010802@selasky.org> <54A53F4F.2000003@selasky.org> <54A92ED1.2070906@selasky.org> Date: Sun, 4 Jan 2015 10:58:54 -0800 X-Google-Sender-Auth: zPrMzqvbPxhpXxB-ysT2PDMSxIY Message-ID: Subject: Re: [RFC] kern/kern_timeout.c rewrite in progress From: Adrian Chadd To: Hans Petter Selasky Content-Type: text/plain; charset=UTF-8 Cc: Ivan Klymenko , FreeBSD Current , "freebsd-arch@freebsd.org" X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Jan 2015 18:58:56 -0000 Hi! Can you throw this into reviews.freebsd.org please? This is something that should be very closely reviewed and tested. (I'm going to go over this quite closely as it related to a lot of the random crap I do ..) -adrian On 4 January 2015 at 04:15, Hans Petter Selasky wrote: > Hi, > > Please find attached an updated timeout patch which also updates clients in > the kernel area to use the callout API properly, like cv_timedwait(). > Previously there was some custom sleepqueue code in the callout subsystem. > All of that has now been removed and we allow callouts to be protected by > spinlocks. This allows us to tear down the callback like done with regular > mutexes, and a "td_slpmutex" has been added to "struct thread" to atomically > teardown the "td_slpcallout". Further the "TDF_TIMOFAIL" and > "SWT_SLEEPQTIMO" states can now be completely removed. > > Summary of changes: > > 1) Make consistent callout API which also supports spinlocks for the > callback function. This has been done to allow atomic callout stop of > "td_slpcallout" without the need of many kernel threading quirks. > > 2) It is not allowed to migrate CPU if the timeout is restarted while the > timeout callback is executing. Callouts must be stopped before CPU migration > is allowed. Optionally drained. > > 3) Shared lock support has been removed, because it prevents atomic stop of > the callback function. > > 4) A new API to drain callouts asynchronously has been added, called > "callout_drain_async()". > > Please test and report any errors! > > Patch applies to FreeBSD-11-current as of today. > > Thank you! > > --HPS > > > _______________________________________________ > freebsd-arch@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-arch > To unsubscribe, send any mail to "freebsd-arch-unsubscribe@freebsd.org"