From owner-freebsd-drivers@FreeBSD.ORG Tue Aug 26 13:04:21 2014 Return-Path: Delivered-To: freebsd-drivers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C044C794 for ; Tue, 26 Aug 2014 13:04:21 +0000 (UTC) Received: from na01-bn1-obe.outbound.protection.outlook.com (mail-bn1lp0144.outbound.protection.outlook.com [207.46.163.144]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client CN "mail.protection.outlook.com", Issuer "MSIT Machine Auth CA 2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5BE023470 for ; Tue, 26 Aug 2014 13:04:20 +0000 (UTC) Received: from BY1PR0301MB0902.namprd03.prod.outlook.com (25.160.195.141) by BY1PR0301MB0902.namprd03.prod.outlook.com (25.160.195.141) with Microsoft SMTP Server (TLS) id 15.0.1005.10; Tue, 26 Aug 2014 13:04:11 +0000 Received: from BY1PR0301MB0902.namprd03.prod.outlook.com ([25.160.195.141]) by BY1PR0301MB0902.namprd03.prod.outlook.com ([25.160.195.141]) with mapi id 15.00.1005.008; Tue, 26 Aug 2014 13:04:11 +0000 From: Wei Hu To: "freebsd-drivers@freebsd.org" Subject: Way to run a routine on different cpu Thread-Topic: Way to run a routine on different cpu Thread-Index: Ac/BLWyO7AuI+zwNT8+jkYIIcCHfKw== Date: Tue, 26 Aug 2014 13:04:11 +0000 Message-ID: <181e94bf68994dd9a67c6504f7fdf0d7@BY1PR0301MB0902.namprd03.prod.outlook.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [167.220.232.169] x-microsoft-antispam: BCL:0;PCL:0;RULEID:;UriScan:; x-forefront-prvs: 03152A99FF x-forefront-antispam-report: SFV:NSPM; SFS:(6009001)(164054003)(199003)(189002)(108616004)(86362001)(2656002)(81542001)(80022001)(81342001)(85852003)(16236675004)(20776003)(92566001)(107046002)(229853001)(15975445006)(15202345003)(107886001)(90102001)(64706001)(76482001)(87936001)(33646002)(66066001)(76576001)(101416001)(106356001)(19300405004)(74502001)(46102001)(86612001)(83322001)(99286002)(95666004)(31966008)(19625215002)(4396001)(77096002)(83072002)(77982001)(54356999)(85306004)(19580395003)(105586002)(2351001)(21056001)(110136001)(99396002)(50986999)(74316001)(79102001)(74662001)(43043002)(24736002); DIR:OUT; SFP:; SCL:1; SRVR:BY1PR0301MB0902; H:BY1PR0301MB0902.namprd03.prod.outlook.com; FPR:; MLV:sfv; PTR:InfoNoRecords; A:1; MX:1; LANG:en; MIME-Version: 1.0 X-OriginatorOrg: microsoft.onmicrosoft.com Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.18-1 X-BeenThere: freebsd-drivers@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Writing device drivers for FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Aug 2014 13:04:21 -0000 Hi, I am wondering what is the right way to run a routine on a differnet cpu an= d wait for it to complete in FreeBSD kernel. For example, on cpu-0 I want t= o send a IPI to cpu-1 to let it run a routine called foo(). On cpu-0 I will= wait till foo() completes. Is smp_rendezvous() the right way to do it? Wha= t if I only want it to run on one cpu, not all cpus? Thanks, Wei