From owner-svn-src-head@FreeBSD.ORG Thu May 3 11:02:11 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 15E051065672; Thu, 3 May 2012 11:02:11 +0000 (UTC) (envelope-from asmrookie@gmail.com) Received: from mail-lpp01m010-f54.google.com (mail-lpp01m010-f54.google.com [209.85.215.54]) by mx1.freebsd.org (Postfix) with ESMTP id DD6308FC14; Thu, 3 May 2012 11:02:09 +0000 (UTC) Received: by lagv3 with SMTP id v3so1572011lag.13 for ; Thu, 03 May 2012 04:02:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=26KrrRFA9EmtBrBwW8+aWzefPagZB56LJTRIECY+0XM=; b=uRIXmDP+RqCWPyASXh6zADRaYClvzfMwnV2v8+r28+BXEOrtaPcsfdkj34IXsx1kTV ssrL5ejCfQgKpIcT4dhk1RwZGXV70Xyhe9Gq3xjDolcM4HQf6CKsYpqLdeJmwH+PWczW F03KuCMxPIs5R8zCaeGeXpeIz8/RV7mFJkRliGvolHtJ9PUbtKbICI5zK/soTR0i27ZP PvtTLje415I5skGs2LP2Tw453Mm/od7L0MQoMso6CG+dYj5i0/KWIjiLQi5HIZJStvza WXMKYy7V0K2L8VoeEW6daBoMzpZRl3zl3H985/CmzQKwlBRGZOfV11jxMk7ymi9nUODR EkQw== MIME-Version: 1.0 Received: by 10.112.88.66 with SMTP id be2mr847298lbb.36.1336042928518; Thu, 03 May 2012 04:02:08 -0700 (PDT) Sender: asmrookie@gmail.com Received: by 10.112.27.65 with HTTP; Thu, 3 May 2012 04:02:08 -0700 (PDT) In-Reply-To: <201205031038.q43Ac2eZ032779@svn.freebsd.org> References: <201205031038.q43Ac2eZ032779@svn.freebsd.org> Date: Thu, 3 May 2012 12:02:08 +0100 X-Google-Sender-Auth: 2MZjywyNJHk4hlneXs6srWcIfjc Message-ID: From: Attilio Rao To: Konstantin Belousov Content-Type: text/plain; charset=UTF-8 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r234952 - in head/sys: kern sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 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, 03 May 2012 11:02:11 -0000 2012/5/3, Konstantin Belousov : > Author: kib > Date: Thu May 3 10:38:02 2012 > New Revision: 234952 > URL: http://svn.freebsd.org/changeset/base/234952 > > Log: > When callout_reset_on() cannot immediately migrate a callout since it > is running on other cpu, the CALLOUT_PENDING flag is temporarily > cleared. Then, callout_stop() on this, in fact active, callout fails > because CALLOUT_PENDING is not set, and callout_stop() returns 0. > > Now, in sleepq_check_timeout(), the failed callout_stop() causes the > sleepq code to execute mi_switch() without even setting the wmesg, > since the switch-out is supposed to be transient. In fact, the thread > is put off the CPU for full timeout interval, instead of being put on > runq immediately. Until timeout fires, the process is unkillable for > obvious reasons. > > Fix this by marking the migrating callouts with CALLOUT_DFRMIGRATION > flag. The flag is cleared by callout_stop_safe() when the function > detects a migration, besides returning the success. The softclock() > rechecks the flag for migrating callout and cancels its execution if > the flag was cleared meantime. Can you please clarify why you cannot simply drop the deferred migration in the case !CALLOUT_PENDING in callout_stop_safe()? Attilio -- Peace can only be achieved by understanding - A. Einstein