From owner-freebsd-hackers@freebsd.org Fri Jan 19 19:36:54 2018 Return-Path: Delivered-To: freebsd-hackers@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 F3BA2EC3B0B for ; Fri, 19 Jan 2018 19:36:53 +0000 (UTC) (envelope-from mizhka@gmail.com) Received: from mail-lf0-x234.google.com (mail-lf0-x234.google.com [IPv6:2a00:1450:4010:c07::234]) (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 77F9870FD0 for ; Fri, 19 Jan 2018 19:36:53 +0000 (UTC) (envelope-from mizhka@gmail.com) Received: by mail-lf0-x234.google.com with SMTP id t139so3396851lff.0 for ; Fri, 19 Jan 2018 11:36:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=lyMgmcKEh9MLWtG81fXFFk+tx/U1MqzKNvp7V8LA3Ik=; b=AHhp8ZezpVoMHODNq42BxJDdO3ASjm9ywG7bgmqUc2JUHQrkW2eo7eG7kYFt6auaE3 TVln91YgruIqdL6cPRJOQyy5/se4lS4kIh4qAAvrKG1A8TM2YbOga5SrrwZSRzafKnWh 4d5qkHweUHdYvMZus2Bw2mb2aTQHo4zPtJ4SPNhuEPqUdJnryc13a7y3ajYCTzyvkB27 GymZ76oN87gy9f6/I9JOEUc2F3JMAxUmARBF2IFR8Qg7QEN2VS/7E4VFCNmEyc4k/dxd IXmgm6MCml4ymzgG+b23utfWNpw7d6A3F9wIqjAtSDAtQEcTcXeOpckopTBMZGltCcY7 uMyA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=lyMgmcKEh9MLWtG81fXFFk+tx/U1MqzKNvp7V8LA3Ik=; b=qpPhu7yMv/OSZgnrkjUDm+lwrS69DkxbJQB8Cx2pxeMb5VCHjir42q5INR2dUz6nj/ RcKWwr+yofRqMhVZ9do/+JHOMPOgYqWHKVCRCNhhjez98SXN2XAKY5+7bvwQ2G/zOu6e W7ecfmpb7bmvZVmmxAuorRKHWfp1G2Y6JIEX2oht6lWrW/BGpvIVePVEYyATxdWRPQO5 KFdO5TgfI5pzNO5/ywLn0G+zZdq5zRxNHh2MuX/SvUlngvuLIxfNOT//H6DFnL1JH/h7 cgyw3wT7qSUiaqsXr4Rtp5okRR5HzRkjOCxAoL8x+FIOhviv72GgyahU+FMb6KfSm6Z4 onKw== X-Gm-Message-State: AKwxytc5UNHBt9HeaqEf+GeqzAZshNgCoz0EnO2EuFG2wcYqbTNmppHh TDOgkeA5UJzT7g4knqG98ppGlQcLdlr6W/J7oC3bo9C0 X-Google-Smtp-Source: ACJfBovN6tOcCUyV6IkSActYKS8Ze3pU45MXSsz7LxnqllMfiXRxMAX781tbo1RGpPcwbeM84dgOFBXVYAt0H/mEdVg= X-Received: by 10.25.228.146 with SMTP id x18mr21937586lfi.115.1516390610665; Fri, 19 Jan 2018 11:36:50 -0800 (PST) MIME-Version: 1.0 Received: by 10.46.101.91 with HTTP; Fri, 19 Jan 2018 11:36:50 -0800 (PST) In-Reply-To: <38c78eec-b598-dc44-8422-ab8fdec0a735@rawbw.com> References: <38c78eec-b598-dc44-8422-ab8fdec0a735@rawbw.com> From: Michael Zhilin Date: Fri, 19 Jan 2018 22:36:50 +0300 Message-ID: Subject: Re: Does the kernel assign CPU affinity automatically? To: Yuri Cc: Freebsd hackers list Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.25 X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Jan 2018 19:36:54 -0000 Hi Yuri, May be just ULE? https://www.usenix.org/legacy/event/bsdcon03/tech/full_papers/roberson/roberson.pdf "The primary goal of ULE on SMP is to prevent unnecessary CPU migration while making good use of available CPU resources. The notion of trying to schedule threads onto the last CPU that they were run on is commonly called CPU affinity. It is important to balance the cost of migrating a CPU with the cost of leaving a CPU idle. " Best regards, Michael. On Fri, Jan 19, 2018 at 10:03 PM, Yuri wrote: > I noticed that my particularly large process always runs on the same CPU > through its lifetime (based on top). This process doesn't use cpuset(1) or > cpuset(2), and cpuset(1) only shows the all-inclusive set: > > $ cpuset -g -p 11511 > pid 11511 mask: 0, 1, 2, 3, 4, 5, 6, 7 > > Does the kernel assign CPU affinity automatically in some cases? There > seems to be some factor besides 'cpuset' that determines affinity. > > > > Thanks, > > Yuri > > > _______________________________________________ > freebsd-hackers@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/freebsd-hackers > To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org" >