From owner-freebsd-hackers@freebsd.org Sun Jul 5 08:06:07 2020 Return-Path: Delivered-To: freebsd-hackers@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A73C5364B55 for ; Sun, 5 Jul 2020 08:06:07 +0000 (UTC) (envelope-from gbe@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4B01VR3tFLz4dFg; Sun, 5 Jul 2020 08:06:07 +0000 (UTC) (envelope-from gbe@freebsd.org) Received: from localhost (p548612f6.dip0.t-ipconnect.de [84.134.18.246]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) (Authenticated sender: gbe) by smtp.freebsd.org (Postfix) with ESMTPSA id 0E2A813EF7; Sun, 5 Jul 2020 08:06:06 +0000 (UTC) (envelope-from gbe@freebsd.org) Date: Sun, 5 Jul 2020 10:06:05 +0200 From: Gordon Bergling To: Andriy Gapon Cc: Allan Jude , freebsd-hackers@freebsd.org Subject: Re: Constant load of 1 on a recent 12-STABLE Message-ID: <20200705080605.GA53520@lion.0xfce3.net> References: <20200603101607.GA80381@lion.0xfce3.net> <20200603202929.GA65032@lion.0xfce3.net> <8b1498ea-e343-506e-79c7-c25b594808f0@freebsd.org> <20200604123720.GA63595@lion.0xfce3.net> <20200623072332.GA54653@lion.0xfce3.net> <0a10a722-3eec-456b-d771-97a49af89ad1@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <0a10a722-3eec-456b-d771-97a49af89ad1@FreeBSD.org> X-Url: X-Operating-System: FreeBSD 12.1-STABLE amd64 X-Host-Uptime: 9:49AM up 1 day, 22:39, 6 users, load averages: 4.89, 4.94, 4.91 X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Jul 2020 08:06:07 -0000 On Thu, Jul 02, 2020 at 10:40:50AM +0300, Andriy Gapon wrote: > On 23/06/2020 10:23, Gordon Bergling wrote: > > What is maybe also related to the problem is the following top output, > > collected by 'top -HS'. The three zfskern threads generate little load, but that > > constant. The annoying part of the problem is, that the load of 1 is reported and > > that the hostsystem schedules the thread over all 4 physical cores and keeps the > > clockrate at the highest frequency. > > > > PID USERNAME PRI NICE SIZE RES STATE C TIME WCPU COMMAND > > 11 root 155 ki31 0B 64K CPU2 2 17:28 97.39% idle{idle: cpu2} > > 11 root 155 ki31 0B 64K CPU3 3 17:29 96.78% idle{idle: cpu3} > > 11 root 155 ki31 0B 64K CPU1 1 17:29 96.40% idle{idle: cpu1} > > 11 root 155 ki31 0B 64K RUN 0 17:25 96.13% idle{idle: cpu0} > > 8 root -8 - 0B 1040K mmp->m 2 0:44 4.32% zfskern{mmp_thread_enter} > > 8 root -8 - 0B 1040K mmp->m 1 0:44 4.28% zfskern{mmp_thread_enter} > > 8 root -8 - 0B 1040K mmp->m 3 0:44 4.25% zfskern{mmp_thread_enter} > > > > Does anyone has some insight where zfskern is spawned? I maybe can bisect then the resulting change > > which leads to this behaviour. > > That's strange. Those mmp threads shouldn't really be consuming much CPU. > Normally they should just sleep all the time. > Do you use the new ZFS multi-modifier protection feature? I guess not. > Do you have 'multihost' property set on any of your pools? > > The change you were looking for is > r361383 MFC r354804,r354806,r354807,r354885: 10499 Multi-modifier protection (MMP) I didn't use the ZFS multi-modifier protection feature and didn't have the 'multihost' propery set on any of my 3 ZFS pools. Thanks for identifing the particular change. I have tried OpenZFS from ports, which seems to improve the situation, but I went back to the base version since only the zroot pool was found and the two others pools weren't detected. --Gordon > -- > Andriy Gapon From owner-freebsd-hackers@freebsd.org Sun Jul 5 11:39:43 2020 Return-Path: Delivered-To: freebsd-hackers@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 99921368FAA for ; Sun, 5 Jul 2020 11:39:43 +0000 (UTC) (envelope-from agapon@gmail.com) Received: from mail-lj1-f176.google.com (mail-lj1-f176.google.com [209.85.208.176]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4B06Dt5qnZz3Zg8; Sun, 5 Jul 2020 11:39:42 +0000 (UTC) (envelope-from agapon@gmail.com) Received: by mail-lj1-f176.google.com with SMTP id d17so27315916ljl.3; Sun, 05 Jul 2020 04:39:42 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:openpgp:autocrypt :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=J1H7gmPec2PfD5sx7cTkhcrQc30hCNBerBLutZTUQNE=; b=TwpBtrLslexxMf9at4jEYWwz7b59s4xW8Rdx9vbBkBt2U4kvTu4JusBlH8JD73NhUV n+849i/5fUfovERoGbpkAcCVeAkZPh2cX7B1WsbIURjxGTOo1Xnr0tFyy6j4+eeHaPme /Om2RQoSf+C2yvVbYGNLvDhXEHkxY1s8WN6IehuPkyqytrolQk1nuy7cFUb6BSBdNv8R fOr84J9PS0lk6C+pi6AUlJuxF6CZmHUJExOe94l4hUxSNChrVpo1u5rW2W4QQq1uVMZM upFywB9dpvNTPIKmue0gExdejzQoWTbnwUhsFHuqgdzMjMK2QbOTDDmdRsuJWPyTXWr/ 1BPA== X-Gm-Message-State: AOAM5300Lg0FQJjNfR9BGWki33BhIb6kPZcnVoEOKYNf416PSb73EkSC meZBjbhgz1UAHfr1QkbHXdjsxkiSa/g= X-Google-Smtp-Source: ABdhPJwVh+6gyHr1qHqbGpjXzODOr+SGbiB0crR1qQqfIeaQT5BktiputCQl0S1l+vOOW3MRrMnz8A== X-Received: by 2002:a2e:7202:: with SMTP id n2mr579788ljc.7.1593949180702; Sun, 05 Jul 2020 04:39:40 -0700 (PDT) Received: from [192.168.0.88] (east.meadow.volia.net. [93.72.151.96]) by smtp.googlemail.com with ESMTPSA id x17sm10212534lfr.63.2020.07.05.04.39.39 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 05 Jul 2020 04:39:39 -0700 (PDT) Subject: Re: Constant load of 1 on a recent 12-STABLE To: Gordon Bergling Cc: Allan Jude , freebsd-hackers@freebsd.org References: <20200603101607.GA80381@lion.0xfce3.net> <20200603202929.GA65032@lion.0xfce3.net> <8b1498ea-e343-506e-79c7-c25b594808f0@freebsd.org> <20200604123720.GA63595@lion.0xfce3.net> <20200623072332.GA54653@lion.0xfce3.net> <0a10a722-3eec-456b-d771-97a49af89ad1@FreeBSD.org> <20200705080605.GA53520@lion.0xfce3.net> From: Andriy Gapon Openpgp: preference=signencrypt Autocrypt: addr=avg@FreeBSD.org; prefer-encrypt=mutual; keydata= mQINBFm4LIgBEADNB/3lT7f15UKeQ52xCFQx/GqHkSxEdVyLFZTmY3KyNPQGBtyvVyBfprJ7 mAeXZWfhat6cKNRAGZcL5EmewdQuUfQfBdYmKjbw3a9GFDsDNuhDA2QwFt8BmkiVMRYyvI7l N0eVzszWCUgdc3qqM6qqcgBaqsVmJluwpvwp4ZBXmch5BgDDDb1MPO8AZ2QZfIQmplkj8Y6Z AiNMknkmgaekIINSJX8IzRzKD5WwMsin70psE8dpL/iBsA2cpJGzWMObVTtCxeDKlBCNqM1i gTXta1ukdUT7JgLEFZk9ceYQQMJJtUwzWu1UHfZn0Fs29HTqawfWPSZVbulbrnu5q55R4PlQ /xURkWQUTyDpqUvb4JK371zhepXiXDwrrpnyyZABm3SFLkk2bHlheeKU6Yql4pcmSVym1AS4 dV8y0oHAfdlSCF6tpOPf2+K9nW1CFA8b/tw4oJBTtfZ1kxXOMdyZU5fiG7xb1qDgpQKgHUX8 7Rd2T1UVLVeuhYlXNw2F+a2ucY+cMoqz3LtpksUiBppJhw099gEXehcN2JbUZ2TueJdt1FdS ztnZmsHUXLxrRBtGwqnFL7GSd6snpGIKuuL305iaOGODbb9c7ne1JqBbkw1wh8ci6vvwGlzx rexzimRaBzJxlkjNfMx8WpCvYebGMydNoeEtkWldtjTNVsUAtQARAQABtB5BbmRyaXkgR2Fw b24gPGF2Z0BGcmVlQlNELm9yZz6JAlQEEwEIAD4WIQS+LEO7ngQnXA4Bjr538m7TUc1yjwUC WbgsiAIbIwUJBaOagAULCQgHAgYVCAkKCwIEFgIDAQIeAQIXgAAKCRB38m7TUc1yj+JAEACV l9AK/nOWAt/9cufV2fRj0hdOqB1aCshtSrwHk/exXsDa4/FkmegxXQGY+3GWX3deIyesbVRL rYdtdK0dqJyT1SBqXK1h3/at9rxr9GQA6KWOxTjUFURsU7ok/6SIlm8uLRPNKO+yq0GDjgaO LzN+xykuBA0FlhQAXJnpZLcVfPJdWv7sSHGedL5ln8P8rxR+XnmsA5TUaaPcbhTB+mG+iKFj GghASDSfGqLWFPBlX/fpXikBDZ1gvOr8nyMY9nXhgfXpq3B6QCRYKPy58ChrZ5weeJZ29b7/ QdEO8NFNWHjSD9meiLdWQaqo9Y7uUxN3wySc/YUZxtS0bhAd8zJdNPsJYG8sXgKjeBQMVGuT eCAJFEYJqbwWvIXMfVWop4+O4xB+z2YE3jAbG/9tB/GSnQdVSj3G8MS80iLS58frnt+RSEw/ psahrfh0dh6SFHttE049xYiC+cM8J27Aaf0i9RflyITq57NuJm+AHJoU9SQUkIF0nc6lfA+o JRiyRlHZHKoRQkIg4aiKaZSWjQYRl5Txl0IZUP1dSWMX4s3XTMurC/pnja45dge/4ESOtJ9R 8XuIWg45Oq6MeIWdjKddGhRj3OohsltKgkEU3eLKYtB6qRTQypHHUawCXz88uYt5e3w4V16H lCpSTZV/EVHnNe45FVBlvK7k7HFfDDkryLkCDQRZuCyIARAAlq0slcsVboY/+IUJdcbEiJRW be9HKVz4SUchq0z9MZPX/0dcnvz/gkyYA+OuM78dNS7Mbby5dTvOqfpLJfCuhaNYOhlE0wY+ 1T6Tf1f4c/uA3U/YiadukQ3+6TJuYGAdRZD5EqYFIkreARTVWg87N9g0fT9BEqLw9lJtEGDY EWUE7L++B8o4uu3LQFEYxcrb4K/WKmgtmFcm77s0IKDrfcX4doV92QTIpLiRxcOmCC/OCYuO jB1oaaqXQzZrCutXRK0L5XN1Y1PYjIrEzHMIXmCDlLYnpFkK+itlXwlE2ZQxkfMruCWdQXye syl2fynAe8hvp7Mms9qU2r2K9EcJiR5N1t1C2/kTKNUhcRv7Yd/vwusK7BqJbhlng5ZgRx0m WxdntU/JLEntz3QBsBsWM9Y9wf2V4tLv6/DuDBta781RsCB/UrU2zNuOEkSixlUiHxw1dccI 6CVlaWkkJBxmHX22GdDFrcjvwMNIbbyfQLuBq6IOh8nvu9vuItup7qemDG3Ms6TVwA7BD3j+ 3fGprtyW8Fd/RR2bW2+LWkMrqHffAr6Y6V3h5kd2G9Q8ZWpEJk+LG6Mk3fhZhmCnHhDu6CwN MeUvxXDVO+fqc3JjFm5OxhmfVeJKrbCEUJyM8ESWLoNHLqjywdZga4Q7P12g8DUQ1mRxYg/L HgZY3zfKOqcAEQEAAYkCPAQYAQgAJhYhBL4sQ7ueBCdcDgGOvnfybtNRzXKPBQJZuCyIAhsM BQkFo5qAAAoJEHfybtNRzXKPBVwQAKfFy9P7N3OsLDMB56A4Kf+ZT+d5cIx0Yiaf4n6w7m3i ImHHHk9FIetI4Xe54a2IXh4Bq5UkAGY0667eIs+Z1Ea6I2i27Sdo7DxGwq09Qnm/Y65ADvXs 3aBvokCcm7FsM1wky395m8xUos1681oV5oxgqeRI8/76qy0hD9WR65UW+HQgZRIcIjSel9vR XDaD2HLGPTTGr7u4v00UeTMs6qvPsa2PJagogrKY8RXdFtXvweQFz78NbXhluwix2Tb9ETPk LIpDrtzV73CaE2aqBG/KrboXT2C67BgFtnk7T7Y7iKq4/XvEdDWscz2wws91BOXuMMd4c/c4 OmGW9m3RBLufFrOag1q5yUS9QbFfyqL6dftJP3Zq/xe+mr7sbWbhPVCQFrH3r26mpmy841ym dwQnNcsbIGiBASBSKksOvIDYKa2Wy8htPmWFTEOPRpFXdGQ27awcjjnB42nngyCK5ukZDHi6 w0qK5DNQQCkiweevCIC6wc3p67jl1EMFY5+z+zdTPb3h7LeVnGqW0qBQl99vVFgzLxchKcl0 R/paSFgwqXCZhAKMuUHncJuynDOP7z5LirUeFI8qsBAJi1rXpQoLJTVcW72swZ42IdPiboqx NbTMiNOiE36GqMcTPfKylCbF45JNX4nF9ElM0E+Y8gi4cizJYBRr2FBJgay0b9Cp Message-ID: <4e38b243-6596-2f88-2df8-2a954ba70a47@FreeBSD.org> Date: Sun, 5 Jul 2020 14:39:38 +0300 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:60.0) Gecko/20100101 Firefox/60.0 Thunderbird/60.9.0 MIME-Version: 1.0 In-Reply-To: <20200705080605.GA53520@lion.0xfce3.net> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 4B06Dt5qnZz3Zg8 X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of agapon@gmail.com designates 209.85.208.176 as permitted sender) smtp.mailfrom=agapon@gmail.com X-Spamd-Result: default: False [-1.29 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; MID_RHS_MATCH_FROM(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17]; ARC_NA(0.00)[]; DMARC_NA(0.00)[FreeBSD.org]; NEURAL_HAM_LONG(-0.76)[-0.756]; RCVD_COUNT_THREE(0.00)[3]; NEURAL_HAM_MEDIUM(-0.75)[-0.754]; NEURAL_SPAM_SHORT(0.22)[0.217]; RCVD_IN_DNSWL_NONE(0.00)[209.85.208.176:from]; FORGED_SENDER(0.30)[avg@FreeBSD.org,agapon@gmail.com]; RWL_MAILSPIKE_POSSIBLE(0.00)[209.85.208.176:from]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; RCVD_TLS_ALL(0.00)[]; FROM_NEQ_ENVFROM(0.00)[avg@FreeBSD.org,agapon@gmail.com]; RECEIVED_SPAMHAUS_PBL(0.00)[93.72.151.96:received] X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Jul 2020 11:39:43 -0000 On 05/07/2020 11:06, Gordon Bergling wrote: > I didn't use the ZFS multi-modifier protection feature and didn't have the 'multihost' > propery set on any of my 3 ZFS pools. Thanks for identifing the particular change. I > have tried OpenZFS from ports, which seems to improve the situation, but I went back > to the base version since only the zroot pool was found and the two others pools > weren't detected. You can try to use dtrace or hwpmc or some such to see what those mmp threads are doing. -- Andriy Gapon From owner-freebsd-hackers@freebsd.org Sun Jul 5 17:26:07 2020 Return-Path: Delivered-To: freebsd-hackers@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 03A263487D1; Sun, 5 Jul 2020 17:26:07 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-qt1-f196.google.com (mail-qt1-f196.google.com [209.85.160.196]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4B0FwZ1dn8z4C0f; Sun, 5 Jul 2020 17:26:05 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: by mail-qt1-f196.google.com with SMTP id i3so27331832qtq.13; Sun, 05 Jul 2020 10:26:05 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=POo6XM2qW4x9EYSS0Mrj+0zv6zefPmSdaxwEeiJemco=; b=KuHGBVmalihrQzr8N4Pyqu3oNvPY6zLCQOGAM6feyySEL9t7IsL9e/1myu1pj2CxYj KvfDGEPzJz/vQefclYRyBNHiUMEAqNDgmF6+PhfB+izYj4/JTuXyvx4EuVOUAG1B0njt FQnfzh7M0Eu2ma5B7iQbN+eRixonMdtCObdt2iQ+aqnRklnD+dfb15jc+dibJUThOCS6 uqPecJrvDAi74PfVPdEgTWj/iRfL/BQ5l+8SqxSen2fvzlPDl5pLMgCU11KT8btUuGEQ qry9ZwhRfUC8j5vDb5M+9XfXj/fKntbjdLKaaJoGRMPwpD3Jp9EZ4HcyeoqCud1guQJL gWjA== X-Gm-Message-State: AOAM530xUQqPSyaRuE72TWk2WmXxusycUFZfhUHfi+/wScB3XiMfzhyO o3cdp8n51kKA/IH8nqQEi2CG+b6uL7cljM6I4+0HJw== X-Google-Smtp-Source: ABdhPJz1Luy63S5ZT5VsFymzMbRpl1KKZ+fSSTIQ8OWmlVfGX/7y5dPjv0LQWO1J2B+EIntn3QhkftR9fsAAeFbYmoE= X-Received: by 2002:ac8:514d:: with SMTP id h13mr46151268qtn.223.1593969965260; Sun, 05 Jul 2020 10:26:05 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Adrian Chadd Date: Sun, 5 Jul 2020 10:25:52 -0700 Message-ID: Subject: Re: Reviewing two IPFW/netgraph/natd patches (RFC 6598/Carrier Grade NAT) To: Neel Chauhan Cc: "freebsd-hackers@freebsd.org" , FreeBSD Net X-Rspamd-Queue-Id: 4B0FwZ1dn8z4C0f X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of adrianchadd@gmail.com designates 209.85.160.196 as permitted sender) smtp.mailfrom=adrianchadd@gmail.com X-Spamd-Result: default: False [0.61 / 15.00]; FROM_NEQ_ENVFROM(0.00)[adrian@freebsd.org,adrianchadd@gmail.com]; TO_DN_EQ_ADDR_SOME(0.00)[]; RCVD_TLS_ALL(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; DMARC_NA(0.00)[freebsd.org]; ARC_NA(0.00)[]; RWL_MAILSPIKE_GOOD(0.00)[209.85.160.196:from]; URI_COUNT_ODD(1.00)[1]; NEURAL_HAM_LONG(-0.77)[-0.769]; TO_MATCH_ENVRCPT_SOME(0.00)[]; NEURAL_SPAM_SHORT(0.05)[0.053]; RCVD_IN_DNSWL_NONE(0.00)[209.85.160.196:from]; HTTP_TO_IP(1.00)[]; NEURAL_HAM_MEDIUM(-0.68)[-0.676]; FORGED_SENDER(0.30)[adrian@freebsd.org,adrianchadd@gmail.com]; R_DKIM_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; RCVD_COUNT_TWO(0.00)[2]; MIME_TRACE(0.00)[0:+,1:+,2:~]; TAGGED_FROM(0.00)[]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.33 X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Jul 2020 17:26:07 -0000 hi! On Fri, 3 Jul 2020 at 20:12, Neel Chauhan wrote: > Hi freebsd-hackers@, freebsd-net@, > > These two patches that will be described are a continuation of r357092. > > r357092 added support for RFC 6598/Carrier Grade NAT (subnet: > 100.64.0.0/10) in libalias and IPFW in-kernel NAT. > > These two patches add support for RFC 6598 to natd and ng_nat > respectively: > > * natd CGN patch: https://reviews.freebsd.org/D23356 > * ng_nat CGN patch: https://reviews.freebsd.org/D23461 > > Currently, CGN support is missing from natd and ng_nat. > > Could someone please review and/or commit these patches? > I'm happy to commit these if noone complains too much to me about it. I approved one of them. I'll go approve the other now. -adrian > > Best, > > Neel Chauhan > > === > > https://www.neelc.org/ > _______________________________________________ > 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" > From owner-freebsd-hackers@freebsd.org Mon Jul 6 07:22:44 2020 Return-Path: Delivered-To: freebsd-hackers@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E278C35DECE for ; Mon, 6 Jul 2020 07:22:44 +0000 (UTC) (envelope-from arka.sw1988@gmail.com) Received: from mail-lj1-x22d.google.com (mail-lj1-x22d.google.com [IPv6:2a00:1450:4864:20::22d]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4B0cTv5Z2pz4sX6 for ; Mon, 6 Jul 2020 07:22:43 +0000 (UTC) (envelope-from arka.sw1988@gmail.com) Received: by mail-lj1-x22d.google.com with SMTP id f5so28199777ljj.10 for ; Mon, 06 Jul 2020 00:22:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=/SFbcV+i0vZZ47NMuYOEbw9+8NIBGICVrm/0eXX1Tu4=; b=Yjr0g6cP1jV+i/CFqRFMKC1BklC5PHOvQfn2iygGmSWO9DBQHFxeCVLpsHpNCGbtJy P/fgacjjciAQsWM8iInoEe8zUurM/eSFKEy5fP4TaqcKRBHNTrefRjUoPPAgfsLTDm4E vNpUYgd1Xt2lipde+7Kg446XPzfs9au5LHb8gRy0MwYVpmg4+tDVxS2IcESG9yGDLhVz H/94GfTzyRaJip4Q+OPidT5ZbmwzXDeTeq84rhCZDBxOwmwsqZYDIK09bpe9M7s/7IbP WZ6dbOxM6k2TztTIrIa5RaHci77j2+bNKaXDxQf7dIkH+Dj0/VRII+AfuyFFpxiHW7DN d4Sg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=/SFbcV+i0vZZ47NMuYOEbw9+8NIBGICVrm/0eXX1Tu4=; b=nkzj4ZWBhoc3mfPpGYdy1+R6KTAM7k+mBvmc1iigTLIaYqP7X6JsGC79pzQzH4f9ul F7zg/EyM16Cfjs9Wc4+IyQUpQcwKsEm0mKzJpWAhxiY4teo5VkEHk+4R2PWT7g7iRYXK Ur6w+bdcDmDPwPNT2o8rn51eQlQRi3klgBW7lldh10zRbIWwvL6BfdQUphWcihaEpHdp 3MFDYQjmziDd+K4cjjfFzaUBWvQg6vP3B/nY5ndL+kpQ7FqscnhrL55P2tMfySsg4bGQ VdfHNnlEUKJ8BcKPXaP+6syPMMVonuuHpf1AjU3492DK6mRMpAm+8z4zwRewDVNjlUfD qdcw== X-Gm-Message-State: AOAM531gPE+xl68klXuw/aAm3Wb+U0UfOxrZTdqr0eq9tCc8jLJEM9K7 DWjZ38nxHAi2WlR7jubFHeub0HSlckzEQSK6aadO7A== X-Google-Smtp-Source: ABdhPJxP1EGU+hbIrtq/UTxqumnSOsjpypYK4GXYnN76DGBhFrWQ725sbdFE57EmUoVZs3GmPLLzaUglejv3AL3V2x0= X-Received: by 2002:a2e:9c95:: with SMTP id x21mr19661637lji.234.1594020160703; Mon, 06 Jul 2020 00:22:40 -0700 (PDT) MIME-Version: 1.0 From: Arka Sharma Date: Mon, 6 Jul 2020 12:52:28 +0530 Message-ID: Subject: Accessing curthread in a kgdb session To: freebsd-hackers@freebsd.org X-Rspamd-Queue-Id: 4B0cTv5Z2pz4sX6 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=Yjr0g6cP; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of arkasw1988@gmail.com designates 2a00:1450:4864:20::22d as permitted sender) smtp.mailfrom=arkasw1988@gmail.com X-Spamd-Result: default: False [-2.56 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-0.997]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; FROM_HAS_DN(0.00)[]; DWL_DNSWL_NONE(0.00)[gmail.com:dkim]; R_SPF_ALLOW(-0.20)[+ip6:2a00:1450:4000::/36:c]; FREEMAIL_FROM(0.00)[gmail.com]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-hackers@freebsd.org]; TO_DN_NONE(0.00)[]; RCPT_COUNT_ONE(0.00)[1]; NEURAL_HAM_LONG(-0.98)[-0.985]; TO_MATCH_ENVRCPT_ALL(0.00)[]; DKIM_TRACE(0.00)[gmail.com:+]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; RCVD_IN_DNSWL_NONE(0.00)[2a00:1450:4864:20::22d:from]; NEURAL_SPAM_SHORT(0.42)[0.420]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:~]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US]; TAGGED_FROM(0.00)[]; RCVD_TLS_ALL(0.00)[]; RCVD_COUNT_TWO(0.00)[2] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.33 X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Jul 2020 07:22:44 -0000 Dear All, I have connected to kgdb. Now if I want to dump the curthread is there any way to do that ? I have checked the definition of curthread macro for amd64 and it is being read from gs register whose value I am not able to check from kgdb as it says "value not available". Regards, Arka From owner-freebsd-hackers@freebsd.org Tue Jul 7 17:30:36 2020 Return-Path: Delivered-To: freebsd-hackers@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 820FB367AF6 for ; Tue, 7 Jul 2020 17:30:36 +0000 (UTC) (envelope-from gbe@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4B1Twr2zdzz3dW6; Tue, 7 Jul 2020 17:30:36 +0000 (UTC) (envelope-from gbe@freebsd.org) Received: from localhost (p548612f6.dip0.t-ipconnect.de [84.134.18.246]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) (Authenticated sender: gbe) by smtp.freebsd.org (Postfix) with ESMTPSA id 095042EF3E; Tue, 7 Jul 2020 17:30:35 +0000 (UTC) (envelope-from gbe@freebsd.org) Date: Tue, 7 Jul 2020 19:30:34 +0200 From: Gordon Bergling To: Andriy Gapon Cc: Allan Jude , freebsd-hackers@freebsd.org Subject: Re: Constant load of 1 on a recent 12-STABLE Message-ID: <20200707173034.GA92732@lion.0xfce3.net> References: <20200603101607.GA80381@lion.0xfce3.net> <20200603202929.GA65032@lion.0xfce3.net> <8b1498ea-e343-506e-79c7-c25b594808f0@freebsd.org> <20200604123720.GA63595@lion.0xfce3.net> <20200623072332.GA54653@lion.0xfce3.net> <0a10a722-3eec-456b-d771-97a49af89ad1@FreeBSD.org> <20200705080605.GA53520@lion.0xfce3.net> <4e38b243-6596-2f88-2df8-2a954ba70a47@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4e38b243-6596-2f88-2df8-2a954ba70a47@FreeBSD.org> X-Url: X-Operating-System: FreeBSD 12.1-STABLE amd64 X-Host-Uptime: 7:03PM up 4 days, 7:51, 5 users, load averages: 1.04, 1.10, 1.13 X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Jul 2020 17:30:36 -0000 Hi Andriy, On Sun, Jul 05, 2020 at 02:39:38PM +0300, Andriy Gapon wrote: > On 05/07/2020 11:06, Gordon Bergling wrote: > > I didn't use the ZFS multi-modifier protection feature and didn't have the 'multihost' > > propery set on any of my 3 ZFS pools. Thanks for identifing the particular change. I > > have tried OpenZFS from ports, which seems to improve the situation, but I went back > > to the base version since only the zroot pool was found and the two others pools > > weren't detected. > > You can try to use dtrace or hwpmc or some such to see what those mmp threads > are doing. I filed a PR [1] for the issue. I already worked my way through the dtrace one-liners on the wiki, but I wasn't that successful on getting an insight into what ever the mmp threads were doing. I'll try to attend the upcoming Bug Squash Hackathon and work on that issue. --Gordon [1] https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=247829 From owner-freebsd-hackers@freebsd.org Wed Jul 8 09:39:33 2020 Return-Path: Delivered-To: freebsd-hackers@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5677F35BFC7 for ; Wed, 8 Jul 2020 09:39:33 +0000 (UTC) (envelope-from agapon@gmail.com) Received: from mailman.nyi.freebsd.org (mailman.nyi.freebsd.org [IPv6:2610:1c1:1:606c::50:13]) by mx1.freebsd.org (Postfix) with ESMTP id 4B1vQr6rfVz3Xwx for ; Wed, 8 Jul 2020 09:39:32 +0000 (UTC) (envelope-from agapon@gmail.com) Received: by mailman.nyi.freebsd.org (Postfix) id E4E0535CB8D; Wed, 8 Jul 2020 09:39:32 +0000 (UTC) Delivered-To: hackers@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E415535CB8C; Wed, 8 Jul 2020 09:39:32 +0000 (UTC) (envelope-from agapon@gmail.com) Received: from mail-lf1-f46.google.com (mail-lf1-f46.google.com [209.85.167.46]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4B1vQr03yBz3Xyl; Wed, 8 Jul 2020 09:39:31 +0000 (UTC) (envelope-from agapon@gmail.com) Received: by mail-lf1-f46.google.com with SMTP id m26so26469271lfo.13; Wed, 08 Jul 2020 02:39:31 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:from:to:references:cc:openpgp:autocrypt :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=ho1SwJDkktHGFXucWoTBwPnYTZFjJXyGv4veAdwgt6c=; b=gC9puuwWr4raBD46N6l7OXxO2lRd9rE938rL5rwvzD8ZLP7UPzwl6Tu/5YH/IlmWGk swaCH39pxKKVg6pywjeushS34uFH50YfUpLm3ypCeWfW7FvjBAtguIL0o81jqWbWYpx1 nJKvo7R4TGgy4dmCNFrdlfC/5nFfWfBfbBWZNbFNtqySFXE56SMBaJlmmQOBm0x3Dmrc zBNOcQnY+DKo/yhhCOW0MFzUVsb8qKEtpm2jWoXGPW5w/l6app1ENNVkL56X59WI2qWx 04zX7VJA2ezBHjHMnN3iKEpfjGHl4tIudZ/rvLtLzH2mdbxPhbCVPNsP2xiiImKtmIXr SEoA== X-Gm-Message-State: AOAM532QEy3D8JSHC3cMPZ3nqjdoBtgzeo6DzPDkc4mbP6Vy8c8gkc2c 0fx0tLijFz0qwjOqF9G4E4W+Z531Zvw= X-Google-Smtp-Source: ABdhPJzv8S1uFMzEuXGjg5XCLwV7nTV1Q9FedKRIFdvigLV+60hJmDfPGEfQSOC4+KmRbec/GTtYVg== X-Received: by 2002:a05:6512:10ca:: with SMTP id k10mr25438679lfg.177.1594201169946; Wed, 08 Jul 2020 02:39:29 -0700 (PDT) Received: from [192.168.0.88] (east.meadow.volia.net. [93.72.151.96]) by smtp.googlemail.com with ESMTPSA id s14sm780247ljs.52.2020.07.08.02.39.28 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 08 Jul 2020 02:39:29 -0700 (PDT) Subject: Re: driver for cp2112 (USB GPIO and I2C gadget) From: Andriy Gapon To: usb@freebsd.org, FreeBSD Hackers References: Cc: FreeBSD Current Openpgp: preference=signencrypt Autocrypt: addr=avg@FreeBSD.org; prefer-encrypt=mutual; keydata= mQINBFm4LIgBEADNB/3lT7f15UKeQ52xCFQx/GqHkSxEdVyLFZTmY3KyNPQGBtyvVyBfprJ7 mAeXZWfhat6cKNRAGZcL5EmewdQuUfQfBdYmKjbw3a9GFDsDNuhDA2QwFt8BmkiVMRYyvI7l N0eVzszWCUgdc3qqM6qqcgBaqsVmJluwpvwp4ZBXmch5BgDDDb1MPO8AZ2QZfIQmplkj8Y6Z AiNMknkmgaekIINSJX8IzRzKD5WwMsin70psE8dpL/iBsA2cpJGzWMObVTtCxeDKlBCNqM1i gTXta1ukdUT7JgLEFZk9ceYQQMJJtUwzWu1UHfZn0Fs29HTqawfWPSZVbulbrnu5q55R4PlQ /xURkWQUTyDpqUvb4JK371zhepXiXDwrrpnyyZABm3SFLkk2bHlheeKU6Yql4pcmSVym1AS4 dV8y0oHAfdlSCF6tpOPf2+K9nW1CFA8b/tw4oJBTtfZ1kxXOMdyZU5fiG7xb1qDgpQKgHUX8 7Rd2T1UVLVeuhYlXNw2F+a2ucY+cMoqz3LtpksUiBppJhw099gEXehcN2JbUZ2TueJdt1FdS ztnZmsHUXLxrRBtGwqnFL7GSd6snpGIKuuL305iaOGODbb9c7ne1JqBbkw1wh8ci6vvwGlzx rexzimRaBzJxlkjNfMx8WpCvYebGMydNoeEtkWldtjTNVsUAtQARAQABtB5BbmRyaXkgR2Fw b24gPGF2Z0BGcmVlQlNELm9yZz6JAlQEEwEIAD4WIQS+LEO7ngQnXA4Bjr538m7TUc1yjwUC WbgsiAIbIwUJBaOagAULCQgHAgYVCAkKCwIEFgIDAQIeAQIXgAAKCRB38m7TUc1yj+JAEACV l9AK/nOWAt/9cufV2fRj0hdOqB1aCshtSrwHk/exXsDa4/FkmegxXQGY+3GWX3deIyesbVRL rYdtdK0dqJyT1SBqXK1h3/at9rxr9GQA6KWOxTjUFURsU7ok/6SIlm8uLRPNKO+yq0GDjgaO LzN+xykuBA0FlhQAXJnpZLcVfPJdWv7sSHGedL5ln8P8rxR+XnmsA5TUaaPcbhTB+mG+iKFj GghASDSfGqLWFPBlX/fpXikBDZ1gvOr8nyMY9nXhgfXpq3B6QCRYKPy58ChrZ5weeJZ29b7/ QdEO8NFNWHjSD9meiLdWQaqo9Y7uUxN3wySc/YUZxtS0bhAd8zJdNPsJYG8sXgKjeBQMVGuT eCAJFEYJqbwWvIXMfVWop4+O4xB+z2YE3jAbG/9tB/GSnQdVSj3G8MS80iLS58frnt+RSEw/ psahrfh0dh6SFHttE049xYiC+cM8J27Aaf0i9RflyITq57NuJm+AHJoU9SQUkIF0nc6lfA+o JRiyRlHZHKoRQkIg4aiKaZSWjQYRl5Txl0IZUP1dSWMX4s3XTMurC/pnja45dge/4ESOtJ9R 8XuIWg45Oq6MeIWdjKddGhRj3OohsltKgkEU3eLKYtB6qRTQypHHUawCXz88uYt5e3w4V16H lCpSTZV/EVHnNe45FVBlvK7k7HFfDDkryLkCDQRZuCyIARAAlq0slcsVboY/+IUJdcbEiJRW be9HKVz4SUchq0z9MZPX/0dcnvz/gkyYA+OuM78dNS7Mbby5dTvOqfpLJfCuhaNYOhlE0wY+ 1T6Tf1f4c/uA3U/YiadukQ3+6TJuYGAdRZD5EqYFIkreARTVWg87N9g0fT9BEqLw9lJtEGDY EWUE7L++B8o4uu3LQFEYxcrb4K/WKmgtmFcm77s0IKDrfcX4doV92QTIpLiRxcOmCC/OCYuO jB1oaaqXQzZrCutXRK0L5XN1Y1PYjIrEzHMIXmCDlLYnpFkK+itlXwlE2ZQxkfMruCWdQXye syl2fynAe8hvp7Mms9qU2r2K9EcJiR5N1t1C2/kTKNUhcRv7Yd/vwusK7BqJbhlng5ZgRx0m WxdntU/JLEntz3QBsBsWM9Y9wf2V4tLv6/DuDBta781RsCB/UrU2zNuOEkSixlUiHxw1dccI 6CVlaWkkJBxmHX22GdDFrcjvwMNIbbyfQLuBq6IOh8nvu9vuItup7qemDG3Ms6TVwA7BD3j+ 3fGprtyW8Fd/RR2bW2+LWkMrqHffAr6Y6V3h5kd2G9Q8ZWpEJk+LG6Mk3fhZhmCnHhDu6CwN MeUvxXDVO+fqc3JjFm5OxhmfVeJKrbCEUJyM8ESWLoNHLqjywdZga4Q7P12g8DUQ1mRxYg/L HgZY3zfKOqcAEQEAAYkCPAQYAQgAJhYhBL4sQ7ueBCdcDgGOvnfybtNRzXKPBQJZuCyIAhsM BQkFo5qAAAoJEHfybtNRzXKPBVwQAKfFy9P7N3OsLDMB56A4Kf+ZT+d5cIx0Yiaf4n6w7m3i ImHHHk9FIetI4Xe54a2IXh4Bq5UkAGY0667eIs+Z1Ea6I2i27Sdo7DxGwq09Qnm/Y65ADvXs 3aBvokCcm7FsM1wky395m8xUos1681oV5oxgqeRI8/76qy0hD9WR65UW+HQgZRIcIjSel9vR XDaD2HLGPTTGr7u4v00UeTMs6qvPsa2PJagogrKY8RXdFtXvweQFz78NbXhluwix2Tb9ETPk LIpDrtzV73CaE2aqBG/KrboXT2C67BgFtnk7T7Y7iKq4/XvEdDWscz2wws91BOXuMMd4c/c4 OmGW9m3RBLufFrOag1q5yUS9QbFfyqL6dftJP3Zq/xe+mr7sbWbhPVCQFrH3r26mpmy841ym dwQnNcsbIGiBASBSKksOvIDYKa2Wy8htPmWFTEOPRpFXdGQ27awcjjnB42nngyCK5ukZDHi6 w0qK5DNQQCkiweevCIC6wc3p67jl1EMFY5+z+zdTPb3h7LeVnGqW0qBQl99vVFgzLxchKcl0 R/paSFgwqXCZhAKMuUHncJuynDOP7z5LirUeFI8qsBAJi1rXpQoLJTVcW72swZ42IdPiboqx NbTMiNOiE36GqMcTPfKylCbF45JNX4nF9ElM0E+Y8gi4cizJYBRr2FBJgay0b9Cp Message-ID: Date: Wed, 8 Jul 2020 12:39:27 +0300 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:60.0) Gecko/20100101 Firefox/60.0 Thunderbird/60.9.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 4B1vQr03yBz3Xyl X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of agapon@gmail.com designates 209.85.167.46 as permitted sender) smtp.mailfrom=agapon@gmail.com X-Spamd-Result: default: False [-2.42 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCVD_TLS_ALL(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17:c]; FROM_HAS_DN(0.00)[]; MIME_GOOD(-0.10)[text/plain]; TO_MATCH_ENVRCPT_ALL(0.00)[]; DMARC_NA(0.00)[FreeBSD.org]; MID_RHS_MATCH_FROM(0.00)[]; NEURAL_HAM_LONG(-0.86)[-0.855]; RCVD_COUNT_THREE(0.00)[3]; NEURAL_HAM_MEDIUM(-0.82)[-0.821]; NEURAL_HAM_SHORT(-0.75)[-0.746]; RCVD_IN_DNSWL_NONE(0.00)[209.85.167.46:from]; FORGED_SENDER(0.30)[avg@FreeBSD.org,agapon@gmail.com]; RWL_MAILSPIKE_POSSIBLE(0.00)[209.85.167.46:from]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; FROM_NEQ_ENVFROM(0.00)[avg@FreeBSD.org,agapon@gmail.com]; FREEMAIL_ENVFROM(0.00)[gmail.com]; RECEIVED_SPAMHAUS_PBL(0.00)[93.72.151.96:received] X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jul 2020 09:39:33 -0000 On 19/06/2020 17:14, Andriy Gapon wrote: > > If anyone interested in reviewing a new driver please help yourself to: > https://reviews.freebsd.org/D25359 > https://reviews.freebsd.org/D25360 > What might be curious about it is that there are usb, i2c and gpio mixed together. Any interest at all? I am still torn about which of the approaches to take. -- Andriy Gapon From owner-freebsd-hackers@freebsd.org Wed Jul 8 11:34:46 2020 Return-Path: Delivered-To: freebsd-hackers@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 435C135FCE9 for ; Wed, 8 Jul 2020 11:34:46 +0000 (UTC) (envelope-from rahul.dshmkh1@gmail.com) Received: from mail-ej1-x62f.google.com (mail-ej1-x62f.google.com [IPv6:2a00:1450:4864:20::62f]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4B1xzn32TSz3gjv for ; Wed, 8 Jul 2020 11:34:45 +0000 (UTC) (envelope-from rahul.dshmkh1@gmail.com) Received: by mail-ej1-x62f.google.com with SMTP id a1so50044720ejg.12 for ; Wed, 08 Jul 2020 04:34:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=fsw0w7SpgCVHYTPRDBCkgIrcWMAAUMDuHfKLbFwMQ8Q=; b=l2lY9phR5u5jdJCu7txsc8bFIMFLBAjaasqsEV7Cfis/1Q5/9lp5jaldwo2/FMjt34 1fNY9mcNyWE8GS8b+58QqIIaIq91hCOADXr1wBm2xkVbAkNcPeQc7ysilFzQ4NZKoQJE ASfnapoQlKFyu7k1p/p7C4+vQ+rSdIYG8SbCpSIBkeAA9voZ3auKcQJWlhe9SRyIrfER P3JuL5aI+Iaqpsc11KTWjZQxnZ/wqivJCQehZqK/CZjLU3ZZsAXi4gvAOZ+4ude5f32N b485TLUGyn5VDq3FwjAhyH2CMuLFBpxTZxdfHwEFjTvj/IcAhXwkdLa4bFIhpT/03MDk KDHg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=fsw0w7SpgCVHYTPRDBCkgIrcWMAAUMDuHfKLbFwMQ8Q=; b=djNmkPtnjgxoHSIANJ0O5IJJxcC86FCtn/DugwxT+sFQdTgpbYDBnwEfFtHz62zCYf F7tRVeFNsbSwUN13GFoY0W3tVEodBoqajM16rEwZAXWr7bRnClwfmOJRtj/pihWUsbor jT1t/ZLcA9PEVwRJiOknfIWxlpmk7IuSNLKoJPx3gt5y9DE5ZiDle/IMZPae1v4Lpc/t BuhCb9jZKMlm1TTSHZiZjwI+0son5dRLNpVghUnr1b0rV5qnohpc4HN4PmSdWsVQ/VM/ UvBb/sZW+nyeWcQpw0t1YiScTyxzXQ4t/rJ43fcrqCAa5BE0DqbOJyHDWDR5u0kYTjep vnIQ== X-Gm-Message-State: AOAM5327DO7GLVdaW/WPz/5eZ4nTobp+Gk69y5SGX8s/JhbF4wd6Zxxk M0sLlcDSNzZtdl9ghQb+5sAEmu/SWS9BoE2glIpsaHI= X-Google-Smtp-Source: ABdhPJwlKL7wkjZQ70fRAhhPQ0Iciu6boMtpOfdg1LV3wKbyV0HM+uuE7SxyWDUAcJSptoUPIeNcHGCZu/9glk873pU= X-Received: by 2002:a17:906:1245:: with SMTP id u5mr50339402eja.286.1594208083635; Wed, 08 Jul 2020 04:34:43 -0700 (PDT) MIME-Version: 1.0 From: rahul deshmukh Date: Wed, 8 Jul 2020 17:04:26 +0530 Message-ID: Subject: strange output in c program To: freebsd-hackers@freebsd.org X-Rspamd-Queue-Id: 4B1xzn32TSz3gjv X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=l2lY9phR; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of rahuldshmkh1@gmail.com designates 2a00:1450:4864:20::62f as permitted sender) smtp.mailfrom=rahuldshmkh1@gmail.com X-Spamd-Result: default: False [-2.61 / 15.00]; RCVD_TLS_ALL(0.00)[]; ARC_NA(0.00)[]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; NEURAL_HAM_MEDIUM(-0.96)[-0.959]; FROM_HAS_DN(0.00)[]; FREEMAIL_FROM(0.00)[gmail.com]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-hackers@freebsd.org]; TO_DN_NONE(0.00)[]; RCPT_COUNT_ONE(0.00)[1]; NEURAL_HAM_LONG(-1.04)[-1.038]; R_SPF_ALLOW(-0.20)[+ip6:2a00:1450:4000::/36]; DKIM_TRACE(0.00)[gmail.com:+]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; RCVD_IN_DNSWL_NONE(0.00)[2a00:1450:4864:20::62f:from]; NEURAL_SPAM_SHORT(0.39)[0.390]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:~]; FREEMAIL_ENVFROM(0.00)[gmail.com]; RCVD_COUNT_TWO(0.00)[2]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US]; TAGGED_FROM(0.00)[]; DWL_DNSWL_NONE(0.00)[gmail.com:dkim] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.33 X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jul 2020 11:34:46 -0000 Hi Team, i was learning c programming and came across a very strange output. kindly someone please guide me if i am missing anything. rdx@FreeBSD:~/Projects/Clang/chapter3 % uname -a FreeBSD FreeBSD 12.1-RELEASE FreeBSD 12.1-RELEASE r354233 GENERIC amd64 ======================================================================== rdx@FreeBSD:~/Projects/Clang/chapter3 % cat example6.c #include int main() { int a = 300, b, c; if(a >= 400) { printf("shouldn't print\n"); b = 300; } c=200; printf("%d %d\n", b, c); return 0; } ========================================================= rdx@FreeBSD:~/Projects/Clang/chapter3 % make example6 `example6' is up to date. rdx@FreeBSD:~/Projects/Clang/chapter3 % ./example6 300 200==> should be garbage value instead of 300? -- Thank you --------------------- Rahul Deshmukh From owner-freebsd-hackers@freebsd.org Wed Jul 8 11:41:54 2020 Return-Path: Delivered-To: freebsd-hackers@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 94C4036021F for ; Wed, 8 Jul 2020 11:41:54 +0000 (UTC) (envelope-from markoml@markoturk.info) Received: from mail-ed1-f47.google.com (mail-ed1-f47.google.com [209.85.208.47]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4B1y813WTPz3xwN for ; Wed, 8 Jul 2020 11:41:53 +0000 (UTC) (envelope-from markoml@markoturk.info) Received: by mail-ed1-f47.google.com with SMTP id h28so41483417edz.0 for ; Wed, 08 Jul 2020 04:41:53 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=lXMxGmDWDIOTzdzF1oW7kSwUntYSgTxoYseraySRHV8=; b=j+5SNZ35pK47ht34CDbfPYVbwmFvfr7ITw7/vQKLjxAKA0AXFVg/j1bAQWKogk/riu q8QNX1myeCBy5PPz7LqwsnrCj9Lx//qIvsSY2gN6Lfo4snLTdpIIxMPRC0M7j+Ngobl1 BkGGNaZ4mPWM6iCfC2HSi+Nvap2rWN9UBgNZsnYh41D893u5maaQ9gcnCD5K/jS3uL+z ZRRj0bxFPHCJwm3/yqQ1dy9aw2dsShfUZVQTF9+NBvaDZR3BjpB0b/DwjD+TOT2eg1de A45k4SV+ASu2JKBqHvbMJ+t1vja/k9HwL6K31JxwMMwbR0m571gnMSLXRYnyA1cOzaPn 1tyg== X-Gm-Message-State: AOAM532stTMlT0M2SW+Axbl5iujr5gtIIzSnhGg9wOykPmqJJ3rGxAzS aomdPlffTYY/fgHlZGFmtVQZ6Q== X-Google-Smtp-Source: ABdhPJyxEcY6VoZJp8G14wP1/u1PwUF36IMqy7ZSJcUfYipEhaX5B1ush5W3YNdm2co/IFCZVmiViw== X-Received: by 2002:aa7:d845:: with SMTP id f5mr64758746eds.162.1594208512036; Wed, 08 Jul 2020 04:41:52 -0700 (PDT) Received: from vps.markoturk.info (cpe-94-253-207-38.zg2.cable.xnet.hr. [94.253.207.38]) by smtp.gmail.com with ESMTPSA id o8sm1842299ejj.102.2020.07.08.04.41.50 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 08 Jul 2020 04:41:51 -0700 (PDT) Date: Wed, 8 Jul 2020 13:41:49 +0200 From: Marko Turk To: rahul deshmukh Cc: freebsd-hackers@freebsd.org Subject: Re: strange output in c program Message-ID: <20200708114149.GA73229@vps.markoturk.info> References: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="rwEMma7ioTxnRzrJ" Content-Disposition: inline In-Reply-To: X-Rspamd-Queue-Id: 4B1y813WTPz3xwN X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=softfail (mx1.freebsd.org: 209.85.208.47 is neither permitted nor denied by domain of markoml@markoturk.info) smtp.mailfrom=markoml@markoturk.info X-Spamd-Result: default: False [-4.21 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; ARC_NA(0.00)[]; RECEIVED_SPAMHAUS_PBL(0.00)[94.253.207.38:received]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; NEURAL_HAM_MEDIUM(-0.86)[-0.861]; NEURAL_HAM_LONG(-1.00)[-0.998]; TAGGED_RCPT(0.00)[]; MIME_GOOD(-0.20)[multipart/signed,text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-hackers@freebsd.org]; R_SPF_SOFTFAIL(0.00)[~all]; DMARC_NA(0.00)[markoturk.info]; RCVD_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_SOME(0.00)[]; NEURAL_HAM_SHORT(-0.15)[-0.147]; RCPT_COUNT_TWO(0.00)[2]; RCVD_IN_DNSWL_NONE(0.00)[209.85.208.47:from]; SIGNED_PGP(-2.00)[]; FREEMAIL_TO(0.00)[gmail.com]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:~]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; RCVD_TLS_ALL(0.00)[]; RWL_MAILSPIKE_POSSIBLE(0.00)[209.85.208.47:from] X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jul 2020 11:41:54 -0000 --rwEMma7ioTxnRzrJ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Jul 08, 2020 at 05:04:26PM +0530, rahul deshmukh wrote: > Hi Team, > i was learning c programming and came across a very strange output. kindly > someone please guide me if i am missing anything. >=20 > rdx@FreeBSD:~/Projects/Clang/chapter3 % uname -a > FreeBSD FreeBSD 12.1-RELEASE FreeBSD 12.1-RELEASE r354233 GENERIC amd64 > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > rdx@FreeBSD:~/Projects/Clang/chapter3 % cat example6.c > #include > int main() > { > int a =3D 300, b, c; > if(a >=3D 400) > { > printf("shouldn't print\n"); > b =3D 300; > } > c=3D200; > printf("%d %d\n", b, c); > return 0; > } > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D > rdx@FreeBSD:~/Projects/Clang/chapter3 % make example6 > `example6' is up to date. > rdx@FreeBSD:~/Projects/Clang/chapter3 % ./example6 > 300 200=3D=3D> should be garbage value instead of 300? The behaviour is undefined so anything can happen. Even different optimization flags can change the value printed. BR/Marko --rwEMma7ioTxnRzrJ Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEhcgjUnLArcQCyVEgeDpsXaaozYgFAl8FsPwACgkQeDpsXaao zYjDwA/+Ik8dW1mj/1r3GsZV+THyz9eAbSMot7bkV6I5Q50+h3wovBvbmkJWbTMU +y0YBsD1G0X9HY7D4vp+HBFizEDk8W4+hG73ZjhL10c5TKycuhwisMco3m0ngXKm ip6xAmiF0PrE6hvLec7HosXLeasB8+6Jtms3OS/RHuElGkQZPEAzU0DJpns+pFew ZOlkt0sXyA9Rbub8hHWfNVu7NEwwIz9WDNEBtwrWKAhqd3qGhh/oQ2eeCog3N0Gn xaW4AQxbwjfoBI7oH+qFy6kvnpvbjXGnL3A/S38P5rPKM2BisdiX1lp9eK+8+Ntb UH1KPr2qcW/wfFfDKVvFNvtk537WJiuhXb3YNzvPm5caYEDGrOpVofxz18hhBJQh vHpJKOKyehOEV7r/QSsoXBoHTNoPnpKx2vkKkb/4esRNJdkKzcqpPWPVTLMfyLb1 QPvEmZOOtJXCfx7OVDROmw6RpCdrT8i6qzYZmqu+nr0WpBaky/Eto/4+EnUtujff gHXAidPTaoNMLRESIQPHJefzUFzgUhU+NMLO6EInAsXtwQ9R9i0UaVuKU6v0pGLF fjJmWmSZlWH/TWOqt0mzHi1xv6QvjmsDcrc6tv0w+CAPD3FZVfMJ8608HT/8m9rd 3bHCDrcsBrHAacsUGDa7c+Wr+nPyel+f17JjlZobEHhEBntW6AQ= =mLH7 -----END PGP SIGNATURE----- --rwEMma7ioTxnRzrJ-- From owner-freebsd-hackers@freebsd.org Wed Jul 8 11:42:54 2020 Return-Path: Delivered-To: freebsd-hackers@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 11FF836042B for ; Wed, 8 Jul 2020 11:42:54 +0000 (UTC) (envelope-from phk@critter.freebsd.dk) Received: from phk.freebsd.dk (phk.freebsd.dk [130.225.244.222]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4B1y990hvwz3y1L for ; Wed, 8 Jul 2020 11:42:52 +0000 (UTC) (envelope-from phk@critter.freebsd.dk) Received: from critter.freebsd.dk (v-critter.freebsd.dk [192.168.55.3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by phk.freebsd.dk (Postfix) with ESMTPS id 5FFB81AF1A8; Wed, 8 Jul 2020 11:42:45 +0000 (UTC) Received: from critter.freebsd.dk (localhost [127.0.0.1]) by critter.freebsd.dk (8.15.2/8.15.2) with ESMTPS id 068BgjOj060592 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Wed, 8 Jul 2020 11:42:45 GMT (envelope-from phk@critter.freebsd.dk) Received: (from phk@localhost) by critter.freebsd.dk (8.15.2/8.15.2/Submit) id 068BgiWi060591; Wed, 8 Jul 2020 11:42:44 GMT (envelope-from phk) To: rahul deshmukh cc: freebsd-hackers@freebsd.org Subject: Re: strange output in c program In-reply-to: From: "Poul-Henning Kamp" References: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <60589.1594208564.1@critter.freebsd.dk> Date: Wed, 08 Jul 2020 11:42:44 +0000 Message-ID: <60590.1594208564@critter.freebsd.dk> X-Rspamd-Queue-Id: 4B1y990hvwz3y1L X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of phk@critter.freebsd.dk designates 130.225.244.222 as permitted sender) smtp.mailfrom=phk@critter.freebsd.dk X-Spamd-Result: default: False [-2.45 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-0.98)[-0.980]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+mx]; NEURAL_HAM_LONG(-0.98)[-0.979]; TAGGED_RCPT(0.00)[]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[freebsd.dk]; RCVD_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_SOME(0.00)[]; NEURAL_HAM_SHORT(-0.49)[-0.495]; RCPT_COUNT_TWO(0.00)[2]; FREEMAIL_TO(0.00)[gmail.com]; FORGED_SENDER(0.30)[phk@phk.freebsd.dk,phk@critter.freebsd.dk]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:1835, ipnet:130.225.0.0/16, country:EU]; FROM_NEQ_ENVFROM(0.00)[phk@phk.freebsd.dk,phk@critter.freebsd.dk]; RCVD_TLS_ALL(0.00)[] X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jul 2020 11:42:54 -0000 -------- rahul deshmukh writes: > #include > int main() > { > int a = 300, b, c; > if(a >= 400) > { > printf("shouldn't print\n"); > b = 300; > } > c=200; > printf("%d %d\n", b, c); > return 0; > } > ========================================================= > rdx@FreeBSD:~/Projects/Clang/chapter3 % make example6 > `example6' is up to date. > rdx@FreeBSD:~/Projects/Clang/chapter3 % ./example6 > 300 200==> should be garbage value instead of 300? 300 is a perfectly valid garbage value :-) -- Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 phk@FreeBSD.ORG | TCP/IP since RFC 956 FreeBSD committer | BSD since 4.3-tahoe Never attribute to malice what can adequately be explained by incompetence. From owner-freebsd-hackers@freebsd.org Wed Jul 8 12:59:31 2020 Return-Path: Delivered-To: freebsd-hackers@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 694CA3623FF for ; Wed, 8 Jul 2020 12:59:31 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: from mail-wm1-x334.google.com (mail-wm1-x334.google.com [IPv6:2a00:1450:4864:20::334]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4B1zsZ2kNsz43K3 for ; Wed, 8 Jul 2020 12:59:30 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: by mail-wm1-x334.google.com with SMTP id w3so2989732wmi.4 for ; Wed, 08 Jul 2020 05:59:30 -0700 (PDT) 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=cGq7OujnL7C/aX+XYmPwki4+aLcCvy+NbpIbXrF+ZEs=; b=e6MP8YTI/egRr/5d5MnZCQE3UI9SwS8smejCCajqWKEFAWB6s5Cv+cJHSnONuC2Vmb mHSz42bCepaWeyzpl+qqcPFlqOvFBi6DXElK1HPxRzsnsxE4y4u1KW9p6C0MRmDlp54S DS8VmoR3rs4AuEI5MeE0PkYIkEdCxXsGooj2urMZr+sJ3/FCorTSpE1MxBYIZbnQ6qxR yGD6YKXhBdauZ/U/UnQL1czeZp2BIKver5zUDwnr2y00a6o6GDKh/gwQnhE5KVjHuwT/ vXT9GID0KFT6YbXRf6Li2hE7B6EqH/cmyyuAL3pR3qyGHLWMqA9Hpp3A4qhGQ63JiJUM a9Mg== 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=cGq7OujnL7C/aX+XYmPwki4+aLcCvy+NbpIbXrF+ZEs=; b=mwQQlZcUEqpV9PjoCMuka1a4hDGJ7foSXPGn6rs3FluZU4mJ6+5nuFXagq5EtMCkOM 9f68NMoZZDtFwUS9ClAngZKdfM71h4Y8eyUrQ/Lv1tcPTMO8rkcvdpHi3QuaUyHQSnfz Cbnrea7uDXdxnlaiR3h7nYkYZEjw8Td4QoL29GtosacoVl0hh0EVHtKfI0JhTG3NdaUL vtSAj1TO0zQhCR9iq8WKALzhclc3QrfIrv0AxirP86dEnFBygNA0m9A3ZNAI3tpc0pap xaLZVfFmwlRW0CnJOggvODhvQzCfSCNdg/Lz/CtFWxgBN5DqYN48shCtyNGEKP/tlu+v u41w== X-Gm-Message-State: AOAM532gbEn/JPNeAm8loxHccERnFT7imCAsnHWWYX82XneyC/Qj0s/T 0n1lg/Wyyrz3FlQacZBkpQS3/Au+SSqTpyklYyPtdg== X-Google-Smtp-Source: ABdhPJzbgC/OxuCFa4TRFC6YieNYCsjkYWjsdCbtgh8PJGjJn/y5HjJjn5gJr8RWtp+RscndKx8D3GXN4OK/K2Hr+PI= X-Received: by 2002:a05:600c:20d3:: with SMTP id y19mr9717558wmm.10.1594213168776; Wed, 08 Jul 2020 05:59:28 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:adf:9d84:0:0:0:0:0 with HTTP; Wed, 8 Jul 2020 05:59:27 -0700 (PDT) In-Reply-To: References: From: Mateusz Guzik Date: Wed, 8 Jul 2020 14:59:27 +0200 Message-ID: Subject: Re: strange output in c program To: rahul deshmukh Cc: freebsd-hackers@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 4B1zsZ2kNsz43K3 X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=e6MP8YTI; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of mjguzik@gmail.com designates 2a00:1450:4864:20::334 as permitted sender) smtp.mailfrom=mjguzik@gmail.com X-Spamd-Result: default: False [-3.04 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-0.98)[-0.980]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip6:2a00:1450:4000::/36:c]; FREEMAIL_FROM(0.00)[gmail.com]; TAGGED_RCPT(0.00)[]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-hackers@freebsd.org]; NEURAL_HAM_LONG(-1.02)[-1.021]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[gmail.com:+]; RCPT_COUNT_TWO(0.00)[2]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; RCVD_IN_DNSWL_NONE(0.00)[2a00:1450:4864:20::334:from]; NEURAL_HAM_SHORT(-0.04)[-0.040]; FREEMAIL_TO(0.00)[gmail.com]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[]; DWL_DNSWL_NONE(0.00)[gmail.com:dkim] X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jul 2020 12:59:31 -0000 On 7/8/20, rahul deshmukh wrote: > Hi Team, > i was learning c programming and came across a very strange output. kindly > someone please guide me if i am missing anything. > > rdx@FreeBSD:~/Projects/Clang/chapter3 % uname -a > FreeBSD FreeBSD 12.1-RELEASE FreeBSD 12.1-RELEASE r354233 GENERIC amd64 > ======================================================================== > rdx@FreeBSD:~/Projects/Clang/chapter3 % cat example6.c > #include > int main() > { > int a = 300, b, c; > if(a >= 400) > { > printf("shouldn't print\n"); > b = 300; > } > c=200; > printf("%d %d\n", b, c); > return 0; > } > ========================================================= > rdx@FreeBSD:~/Projects/Clang/chapter3 % make example6 > `example6' is up to date. > rdx@FreeBSD:~/Projects/Clang/chapter3 % ./example6 > 300 200==> should be garbage value instead of 300? > 300 is perfectly fine garbage. You are tricking yourself a little bit here by expecting something glaringly obvious. Take a look at this (ran on fresh development version, FreeBSD clang version 10.0.1 (git@github.com:llvm/llvm-project.git llvmorg-10.0.1-rc1-0-gf79cd71e145): $ cc -O2 test.c $ ./a.out 300 200 $ cc -O0 test.c $ ./a.out 32767 200 Same source code, different compilation flags resulting in different assembly. Correct enough and useful way to look at it is: since b is not initialized, the behavior is undefined. This means literally anything can happen. In practice for code like this the compiler will tend to generate the call to printf, but some values which will get passed down will be (a possibly) unintentional side effect of assembly which precedes said call. The function will read the stack and/or various registers and *something* is always there. If the source code is correct, it is the intended stuff. If the source is not correct (like in your testcase), it can be just about anything including leftovers from previous calls. So no, a buggy program is not guaranteed to print something which looks wrong. -- Mateusz Guzik From owner-freebsd-hackers@freebsd.org Wed Jul 8 14:25:46 2020 Return-Path: Delivered-To: freebsd-hackers@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5FF11363EBB for ; Wed, 8 Jul 2020 14:25:46 +0000 (UTC) (envelope-from pjfloyd@wanadoo.fr) Received: from smtp.smtpout.orange.fr (smtp03.smtpout.orange.fr [80.12.242.125]) (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (Client CN "Bizanga Labs SMTP Client Certificate", Issuer "Bizanga Labs CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4B21n52HYzz47RV for ; Wed, 8 Jul 2020 14:25:44 +0000 (UTC) (envelope-from pjfloyd@wanadoo.fr) Received: from wwinf1k08 ([10.223.65.51]) by mwinf5d06 with ME id 0eRi2300J16MGNa03eRiMd; Wed, 08 Jul 2020 16:25:42 +0200 X-ME-Helo: wwinf1k08 X-ME-Auth: cGpmbG95ZEB3YW5hZG9vLmZy X-ME-Date: Wed, 08 Jul 2020 16:25:42 +0200 X-ME-IP: 2.7.112.8 Date: Wed, 8 Jul 2020 16:25:42 +0200 (CEST) From: Paul FLOYD Reply-To: Paul FLOYD To: freebsd-hackers@freebsd.org Message-ID: <267885064.4984.1594218342653.JavaMail.www@wwinf1k08> In-Reply-To: References: Subject: re: strange output in c program MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Originating-IP: [2.7.112.8] X-WUM-FROM: |~| X-WUM-TO: |~| X-WUM-REPLYTO: |~| X-Rspamd-Queue-Id: 4B21n52HYzz47RV X-Spamd-Bar: +++++ Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=none (mx1.freebsd.org: domain of pjfloyd@wanadoo.fr has no SPF policy when checking 80.12.242.125) smtp.mailfrom=pjfloyd@wanadoo.fr X-Spamd-Result: default: False [5.12 / 15.00]; HAS_REPLYTO(0.00)[pjfloyd@wanadoo.fr]; HAS_XOIP(0.00)[]; FREEMAIL_FROM(0.00)[wanadoo.fr]; TO_DN_NONE(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; RCVD_TLS_LAST(0.00)[]; R_DKIM_NA(0.00)[]; ASN(0.00)[asn:3215, ipnet:80.12.240.0/20, country:FR]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[wanadoo.fr]; ARC_NA(0.00)[]; REPLYTO_EQ_FROM(0.00)[]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_SPAM_SHORT(1.69)[1.693]; MIME_GOOD(-0.10)[text/plain]; FREEMAIL_REPLYTO(0.00)[wanadoo.fr]; AUTH_NA(1.00)[]; NEURAL_SPAM_MEDIUM(1.05)[1.047]; RCPT_COUNT_ONE(0.00)[1]; DMARC_NA(0.00)[wanadoo.fr]; NEURAL_SPAM_LONG(0.98)[0.983]; RCVD_IN_DNSWL_NONE(0.00)[80.12.242.125:from]; R_SPF_NA(0.00)[no SPF record]; RWL_MAILSPIKE_POSSIBLE(0.00)[80.12.242.125:from]; MID_RHS_NOT_FQDN(0.50)[]; RCVD_COUNT_TWO(0.00)[2] X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jul 2020 14:25:46 -0000 As already said, when you have UB anything can happen. First recommendation. Listen to your compiler! paulf> clang -Weverything -g -o test2 test2.c test2.c:5:7: warning: variable 'b' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized] if(a >= 400) ^~~~~~~~ test2.c:11:22: note: uninitialized use occurs here printf("%d %d\n", b, c); ^ test2.c:5:4: note: remove the 'if' if its condition is always true if(a >= 400) ^~~~~~~~~~~~ test2.c:4:18: note: initialize the variable 'b' to silence this warning int a = 300, b, c; ^ = 0 clang is even telling you how to fix your errors. Even if the compiler can't pick up the error, you can also test at runtime: ==55524== Memcheck, a memory error detector ==55524== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al. ==55524== Using Valgrind-3.17.0.GIT and LibVEX; rerun with -h for copyright info ==55524== Command: ./test2 ==55524== ==55524== Conditional jump or move depends on uninitialised value(s) ==55524== at 0x49B2E65: ??? (in /lib/libc.so.7) ==55524== by 0x49AF184: vfprintf_l (in /lib/libc.so.7) ==55524== by 0x49FB203: printf (in /lib/libc.so.7) ==55524== by 0x20133B: main (test2.c:11) A+ Paul From owner-freebsd-hackers@freebsd.org Wed Jul 8 16:22:18 2020 Return-Path: Delivered-To: freebsd-hackers@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D8683366B8B for ; Wed, 8 Jul 2020 16:22:18 +0000 (UTC) (envelope-from yuri@rawbw.com) Received: from shell1.rawbw.com (shell1.rawbw.com [198.144.192.42]) by mx1.freebsd.org (Postfix) with ESMTP id 4B24MY515Lz4GCQ for ; Wed, 8 Jul 2020 16:22:16 +0000 (UTC) (envelope-from yuri@rawbw.com) Received: from yv.noip.me (c-73-189-35-76.hsd1.ca.comcast.net [73.189.35.76]) (authenticated bits=0) by shell1.rawbw.com (8.15.1/8.15.1) with ESMTPSA id 068GMFj1019035 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO) for ; Wed, 8 Jul 2020 09:22:15 -0700 (PDT) (envelope-from yuri@rawbw.com) X-Authentication-Warning: shell1.rawbw.com: Host c-73-189-35-76.hsd1.ca.comcast.net [73.189.35.76] claimed to be yv.noip.me To: Freebsd hackers list From: Yuri Subject: Is it possible to determine the open file path based on the file descriptor? Message-ID: <21b0280d-c290-f27f-98a9-0c2242380718@rawbw.com> Date: Wed, 8 Jul 2020 09:22:14 -0700 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:68.0) Gecko/20100101 Thunderbird/68.9.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-Rspamd-Queue-Id: 4B24MY515Lz4GCQ X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of yuri@rawbw.com designates 198.144.192.42 as permitted sender) smtp.mailfrom=yuri@rawbw.com X-Spamd-Result: default: False [-0.66 / 15.00]; SUBJECT_ENDS_QUESTION(1.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; ARC_NA(0.00)[]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:198.144.192.32/27]; MIME_GOOD(-0.10)[text/plain]; HAS_XAW(0.00)[]; PREVIOUSLY_DELIVERED(0.00)[freebsd-hackers@freebsd.org]; RCPT_COUNT_ONE(0.00)[1]; NEURAL_HAM_LONG(-1.01)[-1.006]; DMARC_NA(0.00)[rawbw.com]; TO_DN_ALL(0.00)[]; NEURAL_HAM_SHORT(-0.07)[-0.073]; RCVD_IN_DNSWL_NONE(0.00)[198.144.192.42:from]; NEURAL_HAM_MEDIUM(-0.38)[-0.380]; RCVD_NO_TLS_LAST(0.10)[]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_COUNT_TWO(0.00)[2]; ASN(0.00)[asn:7961, ipnet:198.144.192.0/19, country:US]; MID_RHS_MATCH_FROM(0.00)[]; RECEIVED_SPAMHAUS_PBL(0.00)[73.189.35.76:received] X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jul 2020 16:22:18 -0000 Hi Hackers, One of the ports (sysutils/watchman) attempts to find the path of the file based on the file descriptor assuming that this descriptor represents an open file. Is this possible? Thank you, Yuri From owner-freebsd-hackers@freebsd.org Wed Jul 8 16:35:13 2020 Return-Path: Delivered-To: freebsd-hackers@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6AD29366B69 for ; Wed, 8 Jul 2020 16:35:13 +0000 (UTC) (envelope-from damjan.jov@gmail.com) Received: from mail-il1-x135.google.com (mail-il1-x135.google.com [IPv6:2607:f8b0:4864:20::135]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4B24fS3gJvz4H0s for ; Wed, 8 Jul 2020 16:35:12 +0000 (UTC) (envelope-from damjan.jov@gmail.com) Received: by mail-il1-x135.google.com with SMTP id t4so26466846iln.1 for ; Wed, 08 Jul 2020 09:35:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=gliRI1GCa6bUAXeRkSOMs+Rg4Wx7OoYTNSl8iivqR9s=; b=NoCAo9NRkuWkGTEha7m4Mssgrc9tMtJbIe835efWPgDW2ONFpv+ysY1oyzYe1yEq8Y 1v947fYMN6cDukeCbMvbdx1xqjuepMiCGzGdgFUsA5ASthrsQCOQwmJu7P+Y/sdq90r7 c5+ZAh7P8/l9DzNcohAxAHyqXU5KTu/UAMoaxwdPHE2jGCUCHIL3ThQE9Ch2a0a+SCih cwB4FV3zgmwwy150D0QHzvpCWeuzS2dqhvoZXvlcLfWx6oico3OsgENI8ajGxxgijdgH 7H3qPfHYRHNvA+09zwqRXpbvcH/tXjH0mdXn4nuCNg8obP8xaBOkLDJdC1snnvdWTWgL Ggfw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=gliRI1GCa6bUAXeRkSOMs+Rg4Wx7OoYTNSl8iivqR9s=; b=euc6gZUEPf0AWLyvxkZvxnrr5sosQZk+Ez6GTukAGSy2f8xPG0s64z7v7BDPJvJWdX R95VZgUWyXc94JdXhQkaWFwwqzQPa4frLAXqvfENvX9MDWnGIm//+twa3mePUxQAI+0t /SdEgTXLGlunGz78TZiG2j0dh3Ky8sMurbdyJ7CR4M6D7E1xVrD8QExs1a93TPqhVH2o PRQ68piIP61jydbQrc2HHML/msHpReHOYEiVEyJY8fl08vQ6h1QrXLqrOqBfXfmV3hra ui+L1NY7YeAigfPKXu38QumvtoVFtyplc5Nt6oLJ+BGiak80EpH99ebrcvCmCwqGc/uD ypFg== X-Gm-Message-State: AOAM5318yfIqQJfYWDGJmEvVdUGXBsiyjnxLkCBi/hKjsuES0UkbBWrE EjGQ6kzDQinB0IHJ7VZ1TLn5lhFzS9/hvb+XctErAllSSAE= X-Google-Smtp-Source: ABdhPJw1VEi/qDvzjTWmVeOVvo5j3kvlaqAUyEJS83LmGxIPPl4sXzKbm7Gnd3GqnjtD+j4up3rsTD3Q4EMurLInm6Y= X-Received: by 2002:a92:48da:: with SMTP id j87mr44593364ilg.197.1594226111363; Wed, 08 Jul 2020 09:35:11 -0700 (PDT) MIME-Version: 1.0 References: <21b0280d-c290-f27f-98a9-0c2242380718@rawbw.com> In-Reply-To: <21b0280d-c290-f27f-98a9-0c2242380718@rawbw.com> From: Damjan Jovanovic Date: Wed, 8 Jul 2020 18:33:11 +0200 Message-ID: Subject: Re: Is it possible to determine the open file path based on the file descriptor? To: Yuri Cc: Freebsd hackers list X-Rspamd-Queue-Id: 4B24fS3gJvz4H0s X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=NoCAo9NR; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of damjanjov@gmail.com designates 2607:f8b0:4864:20::135 as permitted sender) smtp.mailfrom=damjanjov@gmail.com X-Spamd-Result: default: False [-2.09 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-0.995]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; RCVD_TLS_ALL(0.00)[]; FROM_HAS_DN(0.00)[]; DWL_DNSWL_NONE(0.00)[gmail.com:dkim]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36:c]; FREEMAIL_FROM(0.00)[gmail.com]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-hackers@freebsd.org]; NEURAL_HAM_LONG(-1.05)[-1.048]; TO_MATCH_ENVRCPT_SOME(0.00)[]; TO_DN_ALL(0.00)[]; DKIM_TRACE(0.00)[gmail.com:+]; RCPT_COUNT_TWO(0.00)[2]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::135:from]; NEURAL_HAM_SHORT(-0.05)[-0.051]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:~]; SUBJECT_ENDS_QUESTION(1.00)[]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; TAGGED_FROM(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; RCVD_COUNT_TWO(0.00)[2] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.33 X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jul 2020 16:35:13 -0000 On Wed, Jul 8, 2020 at 6:22 PM Yuri wrote: > Hi Hackers, > > > One of the ports (sysutils/watchman) attempts to find the path of the > file based on the file descriptor assuming that this descriptor > represents an open file. > > > Is this possible? > > procstat fd [pid] Damjan From owner-freebsd-hackers@freebsd.org Wed Jul 8 16:40:04 2020 Return-Path: Delivered-To: freebsd-hackers@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BD55E367302 for ; Wed, 8 Jul 2020 16:40:04 +0000 (UTC) (envelope-from david@catwhisker.org) Received: from mx.catwhisker.org (mx.catwhisker.org [107.204.234.170]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4B24m32x74z4GsJ for ; Wed, 8 Jul 2020 16:40:03 +0000 (UTC) (envelope-from david@catwhisker.org) Received: from albert.catwhisker.org (localhost [127.0.0.1]) by albert.catwhisker.org (8.15.2/8.15.2) with ESMTP id 068GdutK039874; Wed, 8 Jul 2020 16:39:56 GMT (envelope-from david@albert.catwhisker.org) Received: (from david@localhost) by albert.catwhisker.org (8.15.2/8.15.2/Submit) id 068Gduah039873; Wed, 8 Jul 2020 09:39:56 -0700 (PDT) (envelope-from david) Date: Wed, 8 Jul 2020 09:39:56 -0700 From: David Wolfskill To: Yuri Cc: Freebsd hackers list Subject: Re: Is it possible to determine the open file path based on the file descriptor? Message-ID: <20200708163956.GO1462@albert.catwhisker.org> Reply-To: hackers@freebsd.org Mail-Followup-To: hackers@freebsd.org, Yuri , Freebsd hackers list References: <21b0280d-c290-f27f-98a9-0c2242380718@rawbw.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="3EG2G0wNthkGfxoY" Content-Disposition: inline In-Reply-To: <21b0280d-c290-f27f-98a9-0c2242380718@rawbw.com> X-Rspamd-Queue-Id: 4B24m32x74z4GsJ X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of david@catwhisker.org designates 107.204.234.170 as permitted sender) smtp.mailfrom=david@catwhisker.org X-Spamd-Result: default: False [-3.58 / 15.00]; HAS_REPLYTO(0.00)[hackers@freebsd.org]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-0.95)[-0.951]; FROM_HAS_DN(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:107.204.234.170]; NEURAL_HAM_LONG(-1.04)[-1.041]; MIME_GOOD(-0.20)[multipart/signed,text/plain]; SUBJECT_ENDS_QUESTION(1.00)[]; REPLYTO_DOM_NEQ_FROM_DOM(0.00)[]; DMARC_NA(0.00)[catwhisker.org]; TO_MATCH_ENVRCPT_SOME(0.00)[]; TO_DN_ALL(0.00)[]; NEURAL_HAM_SHORT(-0.19)[-0.191]; RCPT_COUNT_TWO(0.00)[2]; RCVD_TLS_LAST(0.00)[]; SIGNED_PGP(-2.00)[]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:~]; RCVD_COUNT_TWO(0.00)[2]; ASN(0.00)[asn:7018, ipnet:107.192.0.0/12, country:US] X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jul 2020 16:40:04 -0000 --3EG2G0wNthkGfxoY Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Jul 08, 2020 at 09:22:14AM -0700, Yuri wrote: > Hi Hackers, >=20 >=20 > One of the ports (sysutils/watchman) attempts to find the path of the=20 > file based on the file descriptor assuming that this descriptor=20 > represents an open file. >=20 >=20 > Is this possible? > .... Not really. For one thing, the concept will be dependent on the design and implementation of the file system, and in common cases (e.g., UFS), there's no guarantee that a particular path is unique (as a given file may have multiple links); there may also be symlinks, and an intermediate node (directory) could be renamed at any point. iAnd I'm sure there are other considerations that don't immediately come to mind. Peace, david --=20 David H. Wolfskill david@catwhisker.org I'd far sooner question Donald Trump's loyalty to the US than Tammy Duckwor= th's. See http://www.catwhisker.org/~david/publickey.gpg for my public key. --3EG2G0wNthkGfxoY Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQGTBAEBCgB9FiEE4owz2QxMJyaxAefyQLJg+bY2PckFAl8F9txfFIAAAAAALgAo aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldEUy OEMzM0Q5MEM0QzI3MjZCMTAxRTdGMjQwQjI2MEY5QjYzNjNEQzkACgkQQLJg+bY2 PckkoQgAoGDAxQIrEI320H9dtQGBcjyw/B4DSOwLfa9VisAi+OlIW9/rrR0/KmEe qVz9jLIYi/tvth1Wgoq5w1hKKDcHzpMAvzyiJ2RqZB8mO0cxys10AIE52eiX30Xd F8uDCl0tRBS5ssuHNUq1+atYxXMirGWnnmEvEnsbEWzxFLNahys/KJWWxD+SLDWa Zo+fiZdKW11QXReHuVXdfQLoF3O4VMsivkkYEmRDu6kJbPJtygksGBMXurGsohWP PWPMqV854wnA4wE2vOK2cl5iuLERg/F/kqHGUBmcja78Vjq0wmlWXsy2zAs8o/Ek ekVw5aWOA4VHDa3Ge5r1NXTajoNOfQ== =OdTf -----END PGP SIGNATURE----- --3EG2G0wNthkGfxoY-- From owner-freebsd-hackers@freebsd.org Wed Jul 8 16:44:55 2020 Return-Path: Delivered-To: freebsd-hackers@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A148536745E for ; Wed, 8 Jul 2020 16:44:55 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: from mail-wm1-x344.google.com (mail-wm1-x344.google.com [IPv6:2a00:1450:4864:20::344]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4B24sf4710z4Hk3 for ; Wed, 8 Jul 2020 16:44:54 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: by mail-wm1-x344.google.com with SMTP id q15so3962755wmj.2 for ; Wed, 08 Jul 2020 09:44:54 -0700 (PDT) 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=u4BJ22WQdhpcGTCNVCoNj4ZYInrPEOaIQ/WeB3GbfJI=; b=VSbXxn9yVPw/6YQ0t78WVY1jY92CkukdYOp5LLP8ZB3zWxn9qF/7FLYH9zG7Tk/u9r qNZYDXfKAj098s5vYmozBtl0hPnfpNMBDN293ZkAh79FvfGxX4qkqMWq1KNAk52edliI Jvm293Cob/XcoQRFWQeSevYaIGTWf1Ymql0rldPdhhLC3pMMLSQ6w/ecB777aCrK72eU gmMBWbHDnPmZaDm9+wXJyVcL95FZNQAOJE+bg2Q8XggXk4Klucxn0FcHRZ9ifdYgutKx DEKThV86a/bqL7fvEvbqN+3tK9dY0SDE6GxDNZWK2vbwemMV/xSDz+XPfEbjD0I93iyH hDTw== 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=u4BJ22WQdhpcGTCNVCoNj4ZYInrPEOaIQ/WeB3GbfJI=; b=WV/lZE+7tdFFBkweuRydJ32442qE9UYdaT0ZFWR7d0jfXyiluwV+9MuXPALPnBupSK Y1qkMpKMGWO4ZeoCzkvCQgNRTPzykKmfzDeGrNcvfbg15Foukl42o5/14TUMVtZh3QnO m7ckTy6sRb1MqTTCMVTRgYC+nN6yFvsZan5X1D3tXN32LvSpMO8E3zGlXTio+QWpr4wJ Fhi4qxThaAyJ1j0Et4na651cIctNhU+qtaT+c0tbqNTE1ZONu1h0nbBCfSA7hlZ9yhSI 9/J0mnj6U6NcmNQpZZFuO9Hwfkdrjqo3SufKS9OONKehc5lkj5JkaVeB6YJjhNvKlQ93 EfUQ== X-Gm-Message-State: AOAM531faFldkJym7iGdOln7l+jOZ7V9Y57fiSVYSKoug9BrDP9Z5VDl Bmnczw9vEH96ltSciJ3KxNxYTQwkz7OKXR5X7J1u3w== X-Google-Smtp-Source: ABdhPJyrj6M7rznlbBgok8av/2SwH9GIZW4QODjxPGE8Dw1Wg0L8+dW388fx66KbmL8J7y7heOQwkdJccy+RqCyh7Jg= X-Received: by 2002:a1c:e90d:: with SMTP id q13mr10509207wmc.187.1594226693075; Wed, 08 Jul 2020 09:44:53 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:adf:9d84:0:0:0:0:0 with HTTP; Wed, 8 Jul 2020 09:44:52 -0700 (PDT) In-Reply-To: <21b0280d-c290-f27f-98a9-0c2242380718@rawbw.com> References: <21b0280d-c290-f27f-98a9-0c2242380718@rawbw.com> From: Mateusz Guzik Date: Wed, 8 Jul 2020 18:44:52 +0200 Message-ID: Subject: Re: Is it possible to determine the open file path based on the file descriptor? To: Yuri Cc: Freebsd hackers list Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 4B24sf4710z4Hk3 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=VSbXxn9y; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of mjguzik@gmail.com designates 2a00:1450:4864:20::344 as permitted sender) smtp.mailfrom=mjguzik@gmail.com X-Spamd-Result: default: False [-2.10 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-0.99)[-0.987]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; RCVD_TLS_ALL(0.00)[]; FROM_HAS_DN(0.00)[]; R_SPF_ALLOW(-0.20)[+ip6:2a00:1450:4000::/36:c]; FREEMAIL_FROM(0.00)[gmail.com]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-hackers@freebsd.org]; NEURAL_HAM_LONG(-1.05)[-1.054]; TO_MATCH_ENVRCPT_SOME(0.00)[]; TO_DN_ALL(0.00)[]; DKIM_TRACE(0.00)[gmail.com:+]; RCPT_COUNT_TWO(0.00)[2]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; RCVD_IN_DNSWL_NONE(0.00)[2a00:1450:4864:20::344:from]; NEURAL_HAM_SHORT(-0.05)[-0.054]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; SUBJECT_ENDS_QUESTION(1.00)[]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US]; RCVD_COUNT_TWO(0.00)[2]; FREEMAIL_ENVFROM(0.00)[gmail.com]; DWL_DNSWL_NONE(0.00)[gmail.com:dkim] X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jul 2020 16:44:55 -0000 On 7/8/20, Yuri wrote: > Hi Hackers, > > > One of the ports (sysutils/watchman) attempts to find the path of the > file based on the file descriptor assuming that this descriptor > represents an open file. > > > Is this possible? > > Yes and no. procstat -f can report that, but not always. The crux is that the namecache is optional -- no name may be present and then we don't have good means to find it. There is a side corner case where you can have *more* than one name and then the kernel has no idea which was used to reach the file for given fd. I think the namecache should start getting new names in all cases and that's perhaps something to change for 13. Even for the working case the interface used by procstat is a bad pick. That said, I can add a fcntl which will translate the fd into a full path if the name can be found, but I don't know how useful it can be with this program given the stipulation above. -- Mateusz Guzik From owner-freebsd-hackers@freebsd.org Wed Jul 8 16:59:38 2020 Return-Path: Delivered-To: freebsd-hackers@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DA5B536776D for ; Wed, 8 Jul 2020 16:59:38 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: from mail-wr1-x441.google.com (mail-wr1-x441.google.com [IPv6:2a00:1450:4864:20::441]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4B25Bf00l1z4JW2 for ; Wed, 8 Jul 2020 16:59:37 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: by mail-wr1-x441.google.com with SMTP id o11so49800615wrv.9 for ; Wed, 08 Jul 2020 09:59:37 -0700 (PDT) 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=aQKJiOZhorhX3QPFtOleDHwIyfKY2C88CiRdr7Eeo5U=; b=F59Yci+UIu+5dgPZtaTwr4vcgPeKFcym5ku7lkaZA9xsOnIIhBhqmo4DofU2DwDIC3 eHVw/svWbedLqMZE9dViqhZBsYWXnAGz19Tbh+z1mUQNSSroKAzzaKpGZ07zoeNPlmGG spAs82Ay2+psVFb1ZyznVDkg+RAD6FV32+n2SvsSXoFCgQLcfrpiFZpbRI5BkRbRdI5o EjWILz7h5GqVnWiG8br7dffLF7suiPLomdSXJAIrXDpta3VgxMhLHqQk163uxV5Co3RN 23/N5QbXvMeHkcLiwcXhMe/3kJ/06FRJNjHJuMaUhc7M70RvqGkRQ9YyG9ruQ+WGQNb3 Uqzg== 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=aQKJiOZhorhX3QPFtOleDHwIyfKY2C88CiRdr7Eeo5U=; b=FRPwTWh249UgDvXiN7qf2n6sYF8oRDQ1jU7y/xWfg2xWiFn3+0CArne25nQXyCxkQp L3OKyR6f8ztNRIsK/Xb24LiCvRsM1YLoP81F0MCPc1gE7zOjV9lmFUrVBhx9KE209sE0 Ss8GdoTRS+4XKqnOzt/CzDPCR+/HCCMbgONsc/nxNnggOegEjhjGUznAlG372DAuGkZc /ITuHR9So6L1DWwFUSEgoXb0AJb76re8y6tkDljDrUvZT2vsICGMrCcPtQZYSWV4lxib Wjf0pEJLSpS3huxmWvXfZNlKtM5McClw4ZMa7JXf2ymbMxzDcy5cnztFOI1iSO2C9d9q ecBw== X-Gm-Message-State: AOAM531S6gjNqUYiF6FDW9+3deFyiAf1kF8aPcOdMkAhFX7GyWRCrRt9 dJoE3Znz41BtuPMSigGg5rms+/c0lyTstXTB/Y1+AQ== X-Google-Smtp-Source: ABdhPJyxF2skPd4oK0D8L5hb44mt3X45wgW4PXmghtJr++TNCbuIQURYnoEFoc1A0vb7ZS/gJu3d7RXGF45wl/YcH4o= X-Received: by 2002:adf:f311:: with SMTP id i17mr61932191wro.237.1594227576373; Wed, 08 Jul 2020 09:59:36 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:adf:9d84:0:0:0:0:0 with HTTP; Wed, 8 Jul 2020 09:59:35 -0700 (PDT) In-Reply-To: References: <21b0280d-c290-f27f-98a9-0c2242380718@rawbw.com> From: Mateusz Guzik Date: Wed, 8 Jul 2020 18:59:35 +0200 Message-ID: Subject: Re: Is it possible to determine the open file path based on the file descriptor? To: Yuri Cc: Freebsd hackers list Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 4B25Bf00l1z4JW2 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=F59Yci+U; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of mjguzik@gmail.com designates 2a00:1450:4864:20::441 as permitted sender) smtp.mailfrom=mjguzik@gmail.com X-Spamd-Result: default: False [-2.10 / 15.00]; RCVD_TLS_ALL(0.00)[]; ARC_NA(0.00)[]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; NEURAL_HAM_MEDIUM(-0.98)[-0.981]; FROM_HAS_DN(0.00)[]; FREEMAIL_FROM(0.00)[gmail.com]; R_SPF_ALLOW(-0.20)[+ip6:2a00:1450:4000::/36]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-hackers@freebsd.org]; NEURAL_HAM_LONG(-1.05)[-1.048]; TO_MATCH_ENVRCPT_SOME(0.00)[]; TO_DN_ALL(0.00)[]; DKIM_TRACE(0.00)[gmail.com:+]; RCPT_COUNT_TWO(0.00)[2]; RCVD_IN_DNSWL_NONE(0.00)[2a00:1450:4864:20::441:from]; NEURAL_HAM_SHORT(-0.07)[-0.072]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; SUBJECT_ENDS_QUESTION(1.00)[]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US]; RCVD_COUNT_TWO(0.00)[2]; FREEMAIL_ENVFROM(0.00)[gmail.com]; DWL_DNSWL_NONE(0.00)[gmail.com:dkim] X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jul 2020 16:59:38 -0000 On 7/8/20, Mateusz Guzik wrote: > On 7/8/20, Yuri wrote: >> Hi Hackers, >> >> >> One of the ports (sysutils/watchman) attempts to find the path of the >> file based on the file descriptor assuming that this descriptor >> represents an open file. >> >> >> Is this possible? >> >> > > Yes and no. procstat -f can report that, but not always. The crux is > that the namecache is optional -- no name may be present and then we > don't have good means to find it. There is a side corner case where > you can have *more* than one name and then the kernel has no idea > which was used to reach the file for given fd. > > I think the namecache should start getting new names in all cases and > that's perhaps something to change for 13. > > Even for the working case the interface used by procstat is a bad pick. > > That said, I can add a fcntl which will translate the fd into a full > path if the name can be found, but I don't know how useful it can be > with this program given the stipulation above. > Now that I wrote that e-mail I remembered I already implemented this, here is a forward version against head: https://people.freebsd.org/~mjg/F_GETPATH.diff #include #define MAXPATHLEN 1024 #define F_GETPATH 22 int main(int argc, char **argv) { char buf[MAXPATHLEN]; int fd; if (argc != 2) return (1); fd = open(argv[1], O_RDONLY); if (fd == -1) err(1, "open"); if (fcntl(fd, F_GETPATH, buf) == -1) err(1, "fcntl"); printf("[%s]\n", buf); } I can't be arsed to find all the proper headers, but you get the idea. If this makes the program work well enough I can commit and merge to stable/12. -- Mateusz Guzik From owner-freebsd-hackers@freebsd.org Wed Jul 8 17:14:36 2020 Return-Path: Delivered-To: freebsd-hackers@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 042043684F0 for ; Wed, 8 Jul 2020 17:14:36 +0000 (UTC) (envelope-from yuri@rawbw.com) Received: from shell1.rawbw.com (shell1.rawbw.com [198.144.192.42]) by mx1.freebsd.org (Postfix) with ESMTP id 4B25Wt6NSgz4KQ7 for ; Wed, 8 Jul 2020 17:14:34 +0000 (UTC) (envelope-from yuri@rawbw.com) Received: from yv.noip.me (c-73-189-35-76.hsd1.ca.comcast.net [73.189.35.76]) (authenticated bits=0) by shell1.rawbw.com (8.15.1/8.15.1) with ESMTPSA id 068HEXNq026052 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO); Wed, 8 Jul 2020 10:14:33 -0700 (PDT) (envelope-from yuri@rawbw.com) X-Authentication-Warning: shell1.rawbw.com: Host c-73-189-35-76.hsd1.ca.comcast.net [73.189.35.76] claimed to be yv.noip.me Subject: Re: Is it possible to determine the open file path based on the file descriptor? To: Mateusz Guzik Cc: Freebsd hackers list References: <21b0280d-c290-f27f-98a9-0c2242380718@rawbw.com> From: Yuri Message-ID: <5a00f93e-21a1-47ab-6e8e-15d24840c525@rawbw.com> Date: Wed, 8 Jul 2020 10:14:32 -0700 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:68.0) Gecko/20100101 Thunderbird/68.9.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-Rspamd-Queue-Id: 4B25Wt6NSgz4KQ7 X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of yuri@rawbw.com designates 198.144.192.42 as permitted sender) smtp.mailfrom=yuri@rawbw.com X-Spamd-Result: default: False [-1.06 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; RECEIVED_SPAMHAUS_PBL(0.00)[73.189.35.76:received]; FROM_HAS_DN(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:198.144.192.32/27:c]; NEURAL_HAM_LONG(-1.01)[-1.014]; MIME_GOOD(-0.10)[text/plain]; HAS_XAW(0.00)[]; DMARC_NA(0.00)[rawbw.com]; NEURAL_SPAM_SHORT(0.04)[0.039]; TO_MATCH_ENVRCPT_SOME(0.00)[]; TO_DN_ALL(0.00)[]; RCPT_COUNT_TWO(0.00)[2]; RCVD_IN_DNSWL_NONE(0.00)[198.144.192.42:from]; NEURAL_HAM_MEDIUM(-0.89)[-0.889]; FREEMAIL_TO(0.00)[gmail.com]; RCVD_NO_TLS_LAST(0.10)[]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:7961, ipnet:198.144.192.0/19, country:US]; SUBJECT_ENDS_QUESTION(1.00)[]; MID_RHS_MATCH_FROM(0.00)[]; RCVD_COUNT_TWO(0.00)[2] X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jul 2020 17:14:36 -0000 On 2020-07-08 09:59, Mateusz Guzik wrote: > I can't be arsed to find all the proper headers, but you get the idea. > If this makes the program work well enough I can commit and merge to > stable/12. This particular project (watchman) looks for F_GETPATH and fails because it isn't defined. If you would add it to 12.1 this would be great. llvm sources also contain references to F_GETPATH. Thank you, Yuri From owner-freebsd-hackers@freebsd.org Wed Jul 8 17:22:13 2020 Return-Path: Delivered-To: freebsd-hackers@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BFCEB368733 for ; Wed, 8 Jul 2020 17:22:13 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: from mail-wr1-x429.google.com (mail-wr1-x429.google.com [IPv6:2a00:1450:4864:20::429]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4B25hh6vxXz4L4K for ; Wed, 8 Jul 2020 17:22:12 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: by mail-wr1-x429.google.com with SMTP id f18so41757453wrs.0 for ; Wed, 08 Jul 2020 10:22:12 -0700 (PDT) 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=IFi6p0Avv0e2wkdvfCkvvc8tEl4M42RYP7uKkpvKs6k=; b=hKteJILnv3R4S+GfpVbo+ibADuVfowzQXJh5FVGakeIgJldenrn8xlgswsuqGUwBze LXSxcdvcbeqscoL2UNNbW+ClG9Vs5w8vUr0+GQNDLsVhd0PiTHSpGAaBPa4V+FqC8EaY GKQ96fIlMHOb457cBfWiP2xMJjCc4eFXAUwRS98IQY7z5E/LMhcP7sLurvHZJUz+mzI6 0+WGCTP/loZknp6NtAxJVECOATD2Ra6sdd/1V4jT12RaTyoLrT3HduhzbozT522SWjt6 D0vxZKId1g+FM1pQAt0iyX/1k2/5/If4zzWOIiZ0eVhyPFPDecBREs7e0U/iceJMep9r BGJA== 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=IFi6p0Avv0e2wkdvfCkvvc8tEl4M42RYP7uKkpvKs6k=; b=Tz774ZwFfOzfYj+LYcz3QE0EAv9erzkOQNnWG6wLQLzLfR9rCqsjXZby70sFiSq1vk 8FBrjdCJcEMpJ1JK27+/Qz/7rJ+KnRvH+4HwPLGuI1Kmq6h4i9KOmsYcj4BtRe6ktS8h Z+rp5yaH9Xf7+c6JLTxdK5UUqDM1j64GOZmtXNyVqK63zJUy+OUIgTtM6GkhDffLYiwr TKWLKCa3B3jw5ykboTTDYQUaCmAutCWSz6+ytvvceWGgxpQU9cp2mdaH/2CVBbrCYEHn hBojvCShtD3Qt40nmg7/VYhfrD2oPuOX06BEPwBxMCsRwYDijOAKBTrSgCx2sKuaLFDh 2tMA== X-Gm-Message-State: AOAM532r2EfaH2LndHdP24fJbuJZJwcl75syOBNqczdPmIiEtwtRtihf h8DD+2BkPEM/JOGxIOS7PKapgnmDBGwdPKwacqF9sg== X-Google-Smtp-Source: ABdhPJwYQ6o/QsyQPlfpwzPE6DknV5OiwfNsqg+CtZPZXAWsFglPu7yMBSzxfOtZnPqslem7AK4GdxBdsLH2bPd/cxc= X-Received: by 2002:a05:6000:1290:: with SMTP id f16mr33037905wrx.66.1594228931493; Wed, 08 Jul 2020 10:22:11 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:adf:9d84:0:0:0:0:0 with HTTP; Wed, 8 Jul 2020 10:22:10 -0700 (PDT) In-Reply-To: <5a00f93e-21a1-47ab-6e8e-15d24840c525@rawbw.com> References: <21b0280d-c290-f27f-98a9-0c2242380718@rawbw.com> <5a00f93e-21a1-47ab-6e8e-15d24840c525@rawbw.com> From: Mateusz Guzik Date: Wed, 8 Jul 2020 19:22:10 +0200 Message-ID: Subject: Re: Is it possible to determine the open file path based on the file descriptor? To: Yuri Cc: Freebsd hackers list Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 4B25hh6vxXz4L4K X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=hKteJILn; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of mjguzik@gmail.com designates 2a00:1450:4864:20::429 as permitted sender) smtp.mailfrom=mjguzik@gmail.com X-Spamd-Result: default: False [-2.16 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-0.99)[-0.987]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; RCVD_TLS_ALL(0.00)[]; FROM_HAS_DN(0.00)[]; R_SPF_ALLOW(-0.20)[+ip6:2a00:1450:4000::/36:c]; FREEMAIL_FROM(0.00)[gmail.com]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-hackers@freebsd.org]; NEURAL_HAM_LONG(-1.05)[-1.054]; TO_MATCH_ENVRCPT_SOME(0.00)[]; TO_DN_ALL(0.00)[]; DKIM_TRACE(0.00)[gmail.com:+]; RCPT_COUNT_TWO(0.00)[2]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; RCVD_IN_DNSWL_NONE(0.00)[2a00:1450:4864:20::429:from]; NEURAL_HAM_SHORT(-0.12)[-0.120]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; SUBJECT_ENDS_QUESTION(1.00)[]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US]; RCVD_COUNT_TWO(0.00)[2]; FREEMAIL_ENVFROM(0.00)[gmail.com]; DWL_DNSWL_NONE(0.00)[gmail.com:dkim] X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jul 2020 17:22:13 -0000 llvm is an example reason why I'm reluctant to add this. llvm currently will perform realpath, which was converted to a syscall and with other upcoming changed will be quite cheap, but most importantly reliable. F_GETPATH can easily fail which makes me really wary of this without always adding names to the namecache. On 7/8/20, Yuri wrote: > On 2020-07-08 09:59, Mateusz Guzik wrote: >> I can't be arsed to find all the proper headers, but you get the idea. >> If this makes the program work well enough I can commit and merge to >> stable/12. > > > This particular project (watchman) looks for F_GETPATH and fails because > it isn't defined. If you would add it to 12.1 this would be great. > > llvm sources also contain references to F_GETPATH. > > > Thank you, > > Yuri > > > -- Mateusz Guzik From owner-freebsd-hackers@freebsd.org Wed Jul 8 17:53:17 2020 Return-Path: Delivered-To: freebsd-hackers@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2DD8E368E87 for ; Wed, 8 Jul 2020 17:53:17 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4B26NW4trJz4MkY for ; Wed, 8 Jul 2020 17:53:15 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id 068Hr1Hu021220 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Wed, 8 Jul 2020 20:53:04 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua 068Hr1Hu021220 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id 068Hr019021218; Wed, 8 Jul 2020 20:53:00 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Wed, 8 Jul 2020 20:53:00 +0300 From: Konstantin Belousov To: Mateusz Guzik Cc: Yuri , Freebsd hackers list Subject: Re: Is it possible to determine the open file path based on the file descriptor? Message-ID: <20200708175300.GA2866@kib.kiev.ua> References: <21b0280d-c290-f27f-98a9-0c2242380718@rawbw.com> <5a00f93e-21a1-47ab-6e8e-15d24840c525@rawbw.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on tom.home X-Rspamd-Queue-Id: 4B26NW4trJz4MkY X-Spamd-Bar: ++ Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=fail reason="No valid SPF, No valid DKIM" header.from=gmail.com (policy=none); spf=softfail (mx1.freebsd.org: 2001:470:d5e7:1::1 is neither permitted nor denied by domain of kostikbel@gmail.com) smtp.mailfrom=kostikbel@gmail.com X-Spamd-Result: default: False [2.68 / 15.00]; ARC_NA(0.00)[]; DMARC_POLICY_SOFTFAIL(0.10)[gmail.com : No valid SPF, No valid DKIM,none]; RCVD_TLS_ALL(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; FREEMAIL_FROM(0.00)[gmail.com]; MIME_GOOD(-0.10)[text/plain]; HAS_XAW(0.00)[]; R_SPF_SOFTFAIL(0.00)[~all:c]; NEURAL_SPAM_MEDIUM(0.94)[0.937]; TO_MATCH_ENVRCPT_SOME(0.00)[]; TO_DN_ALL(0.00)[]; NEURAL_HAM_SHORT(-0.08)[-0.076]; NEURAL_SPAM_LONG(0.81)[0.814]; FREEMAIL_TO(0.00)[gmail.com]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:6939, ipnet:2001:470::/32, country:US]; SUBJECT_ENDS_QUESTION(1.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; RCVD_COUNT_TWO(0.00)[2] X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jul 2020 17:53:17 -0000 On Wed, Jul 08, 2020 at 07:22:10PM +0200, Mateusz Guzik wrote: > llvm is an example reason why I'm reluctant to add this. llvm > currently will perform realpath, which was converted to a syscall and > with other upcoming changed will be quite cheap, but most importantly > reliable. F_GETPATH can easily fail which makes me really wary of this > without always adding names to the namecache. I think an immediately useful addition would be a sysctl or fcntl that return struct kinfo_file for single file descriptor. From owner-freebsd-hackers@freebsd.org Wed Jul 8 18:14:48 2020 Return-Path: Delivered-To: freebsd-hackers@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8DFD8368EFA for ; Wed, 8 Jul 2020 18:14:48 +0000 (UTC) (envelope-from asomers@gmail.com) Received: from mail-oi1-f169.google.com (mail-oi1-f169.google.com [209.85.167.169]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4B26sM3qNqz4NrX for ; Wed, 8 Jul 2020 18:14:47 +0000 (UTC) (envelope-from asomers@gmail.com) Received: by mail-oi1-f169.google.com with SMTP id k22so27250418oib.0 for ; Wed, 08 Jul 2020 11:14:47 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=xmvR/ZPjsdBZVyu0sQrt43kcZELsn5B0BEIYLVdkEkE=; b=cif45mj8DQwC8BpPFuErUkMO5HvbGi69M50jgQ/Say+YHke6/T9TVAl+VrGNyorMvZ TUIypBXxovtp+Dw8QYPz5QdVR2PJwDHhEIz8wmXSpnja27lWrsLSmSEK7jSbhX7cxKGk O8+YVCJhp8EU2pSv+r5cNYu3VECo9a48JTpLfhazUzsFv3x/MH2zfzW3TGr7WFNEEHyA kihLC+thW90ixhMJoK9QUesgNYgvq7zocicRUiehzD+PZejXehv9zJMDdHCge55oc7/V 6PPvxi9FyrugBP5In/nlc8JCy670JAGmSt0L3IVpWU7iaR2vzHMtYcdZXv2kQeWIaZq1 o1EQ== X-Gm-Message-State: AOAM531k+inVnZlCSeRHB8xYpKPWtipOUSq2kJL54x9DxLBOpItQyG4z TF+VRl2bOzcfPqQ1ls1W2WwfDx8AiiaEk4zy6caA7HRW7/M= X-Google-Smtp-Source: ABdhPJxMwix+i2RCfpstOyqI8F/X9Ak0A7eE4Fzd63r+pXoC2cFqzrObxqfMwKAO0o+v1pM8QoTMhLsYMJ1Ts0nYURA= X-Received: by 2002:a54:4f9e:: with SMTP id g30mr8202114oiy.73.1594232086084; Wed, 08 Jul 2020 11:14:46 -0700 (PDT) MIME-Version: 1.0 From: Alan Somers Date: Wed, 8 Jul 2020 12:14:35 -0600 Message-ID: Subject: Are crypto(9) sessions thread safe? To: FreeBSD Hackers X-Rspamd-Queue-Id: 4B26sM3qNqz4NrX X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of asomers@gmail.com designates 209.85.167.169 as permitted sender) smtp.mailfrom=asomers@gmail.com X-Spamd-Result: default: False [0.96 / 15.00]; MIME_TRACE(0.00)[0:+,1:+,2:~]; FREEMAIL_ENVFROM(0.00)[gmail.com]; RCVD_TLS_ALL(0.00)[]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-hackers@freebsd.org]; ARC_NA(0.00)[]; NEURAL_SPAM_MEDIUM(0.13)[0.125]; RCPT_COUNT_ONE(0.00)[1]; NEURAL_HAM_LONG(-0.14)[-0.136]; DMARC_NA(0.00)[freebsd.org]; TO_DN_ALL(0.00)[]; NEURAL_HAM_SHORT(-0.03)[-0.025]; RCVD_IN_DNSWL_NONE(0.00)[209.85.167.169:from]; FORGED_SENDER(0.30)[asomers@freebsd.org,asomers@gmail.com]; RWL_MAILSPIKE_POSSIBLE(0.00)[209.85.167.169:from]; SUBJECT_ENDS_QUESTION(1.00)[]; R_DKIM_NA(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; FROM_NEQ_ENVFROM(0.00)[asomers@freebsd.org,asomers@gmail.com]; TO_DOM_EQ_FROM_DOM(0.00)[] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.33 X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jul 2020 18:14:48 -0000 Are the sessions returned by crypto_newsession safe to use concurrently from multiple threads? I ask because geli currently creates a separate thread pool for each provider, and I'm trying to change that to use a single global thread pool. So I need to know if different threads can share a crypto session, or if each geli provider will still need a pool of sessions. -Alan From owner-freebsd-hackers@freebsd.org Wed Jul 8 21:31:24 2020 Return-Path: Delivered-To: freebsd-hackers@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 687C935531F; Wed, 8 Jul 2020 21:31:24 +0000 (UTC) (envelope-from mmacy@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4B2CDD2BsLz45sn; Wed, 8 Jul 2020 21:31:24 +0000 (UTC) (envelope-from mmacy@freebsd.org) Received: from mail-lj1-f181.google.com (mail-lj1-f181.google.com [209.85.208.181]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) (Authenticated sender: mmacy) by smtp.freebsd.org (Postfix) with ESMTPSA id 295171BA9C; Wed, 8 Jul 2020 21:31:24 +0000 (UTC) (envelope-from mmacy@freebsd.org) Received: by mail-lj1-f181.google.com with SMTP id s9so55869586ljm.11; Wed, 08 Jul 2020 14:31:24 -0700 (PDT) X-Gm-Message-State: AOAM5309htfwCuYFXMlXk3RpsEF0VT9y/jIEZJ7c3twKLlgFQ+MDdkGo 0SyrtMgpjC2mjeWE/DgJRR3CaUwfU5/7CrPN0Ss= X-Google-Smtp-Source: ABdhPJzkPsOrt2Tp54Rq3g/9QQ8qqMdK0dEW7USpjDSngAx8RvmZQ5CXlDzQyEcuoybib73aQ7E0al6TIJhpnuBfg3A= X-Received: by 2002:a2e:943:: with SMTP id 64mr9555237ljj.445.1594243882646; Wed, 08 Jul 2020 14:31:22 -0700 (PDT) MIME-Version: 1.0 From: Matthew Macy Date: Wed, 8 Jul 2020 14:31:11 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: CFT for vendor openzfs To: freebsd-fs , freebsd-hackers@freebsd.org, freebsd-current Content-Type: text/plain; charset="UTF-8" X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jul 2020 21:31:24 -0000 Checkout updated HEAD: % git clone https://github.com/mattmacy/networking.git -b projects/openzfs_vendor freebsd Checkout updated openzfs in to sys/contrib: % git clone https://github.com/zfsonfreebsd/ZoF.git -b projects/openzfs_vendor freebsd/sys/contrib/openzfs Build world and kernel with whatever your usual configuration is. Where possible the openzfs kmod is backward compatible with the cmd utils in HEAD so common operations work with existing tools and the new kmod. In the projects/openzfs_vendor branch of ZoF ozfs libraries are backward compatible with the zfs kmod in HEAD. Although ideally one would test this in a separate boot environment, the interoperability should allow one to rollback without too much difficulty. Thanks in advance for your time. -M From owner-freebsd-hackers@freebsd.org Wed Jul 8 21:39:01 2020 Return-Path: Delivered-To: freebsd-hackers@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 15E9D355B84; Wed, 8 Jul 2020 21:39:01 +0000 (UTC) (envelope-from mmacy@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4B2CP06swrz4698; Wed, 8 Jul 2020 21:39:00 +0000 (UTC) (envelope-from mmacy@freebsd.org) Received: from mail-lj1-f173.google.com (mail-lj1-f173.google.com [209.85.208.173]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) (Authenticated sender: mmacy) by smtp.freebsd.org (Postfix) with ESMTPSA id C9E481B97A; Wed, 8 Jul 2020 21:39:00 +0000 (UTC) (envelope-from mmacy@freebsd.org) Received: by mail-lj1-f173.google.com with SMTP id e8so13866ljb.0; Wed, 08 Jul 2020 14:39:00 -0700 (PDT) X-Gm-Message-State: AOAM533oPBHjaOhWxUQDUAkAC8m8IiXzWr5Fdj+NmkiCesIo2BaXA8gr +jfM8iGj9Kh0RXC8xY6tAR0JVBTFs84wZbSWFhE= X-Google-Smtp-Source: ABdhPJwL4BO4hAzjODcNu461p3QculXkL1tFgcDVJ0yVuQNmP6PstV61cERF9UhP1rNOWpZzYuZikcnz3+/5eAHIFnI= X-Received: by 2002:a05:651c:307:: with SMTP id a7mr33532041ljp.297.1594244339383; Wed, 08 Jul 2020 14:38:59 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Matthew Macy Date: Wed, 8 Jul 2020 14:38:48 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Further note - Re: CFT for vendor openzfs To: freebsd-fs , freebsd-hackers@freebsd.org, freebsd-current Content-Type: text/plain; charset="UTF-8" X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jul 2020 21:39:01 -0000 Do NOT zpool upgrade unless you are willing to live without the ability to ever rollback to the legacy zfs kmod. On Wed, Jul 8, 2020 at 2:31 PM Matthew Macy wrote: > > Checkout updated HEAD: > % git clone https://github.com/mattmacy/networking.git -b > projects/openzfs_vendor freebsd > > Checkout updated openzfs in to sys/contrib: > % git clone https://github.com/zfsonfreebsd/ZoF.git -b > projects/openzfs_vendor freebsd/sys/contrib/openzfs > > Build world and kernel with whatever your usual configuration is. > Where possible the openzfs kmod is backward compatible with the cmd > utils in HEAD so common operations work with existing tools and the > new kmod. In the projects/openzfs_vendor branch of ZoF ozfs libraries > are backward compatible with the zfs kmod in HEAD. Although ideally > one would test this in a separate boot environment, the > interoperability should allow one to rollback without too much > difficulty. > > Thanks in advance for your time. > -M From owner-freebsd-hackers@freebsd.org Thu Jul 9 17:02:39 2020 Return-Path: Delivered-To: freebsd-hackers@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D8EFD350405 for ; Thu, 9 Jul 2020 17:02:39 +0000 (UTC) (envelope-from leres@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4B2jCg5VV8z4Hxf for ; Thu, 9 Jul 2020 17:02:39 +0000 (UTC) (envelope-from leres@freebsd.org) Received: from ice.alameda.xse.com (unknown [IPv6:2600:1700:a570:11f0:f2ad:4eff:fe0b:a065]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: leres) by smtp.freebsd.org (Postfix) with ESMTPSA id 732882481B for ; Thu, 9 Jul 2020 17:02:39 +0000 (UTC) (envelope-from leres@freebsd.org) Subject: Re: FreeBSD Security Advisory FreeBSD-SA-20:19.unbound References: <20200708210700.280D517D45@freefall.freebsd.org> To: freebsd-hackers@freebsd.org From: Craig Leres Message-ID: Date: Thu, 9 Jul 2020 10:02:38 -0700 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <20200708210700.280D517D45@freefall.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Jul 2020 17:02:39 -0000 After upgrading to 11.3-RELEASE-p11 I find that my systems still think they can upgrade to -p11. But the files to be installed aren't. zinc 12 # freebsd-version 11.3-RELEASE-p11 zinc 13 # freebsd-update fetch Looking up update5.freebsd.org mirrors... none found. Fetching metadata signature for 11.3-RELEASE from update5.freebsd.org... done. Fetching metadata index... done. Inspecting system... done. Preparing to download files... done. The following files will be added as part of updating to 11.3-RELEASE-p11: /usr/lib/debug/usr/sbin/local-unbound-anchor.debug /usr/lib/debug/usr/sbin/local-unbound-checkconf.debug /usr/lib/debug/usr/sbin/local-unbound-control.debug /usr/lib/debug/usr/sbin/local-unbound.debug zinc 14 # freebsd-update install Installing updates...install: ///usr/lib/debug/usr/sbin/local-unbound-anchor.debug: No such file or directory install: ///usr/lib/debug/usr/sbin/local-unbound-checkconf.debug: No such file or directory install: ///usr/lib/debug/usr/sbin/local-unbound-control.debug: No such file or directory install: ///usr/lib/debug/usr/sbin/local-unbound.debug: No such file or directory done. Should I create /usr/lib/debug/usr/sbin and update again? Ignoring it is not a good option because I have a cron job to "freebsd-update fetch". Craig From owner-freebsd-hackers@freebsd.org Thu Jul 9 20:38:04 2020 Return-Path: Delivered-To: freebsd-hackers@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A48C2355A34 for ; Thu, 9 Jul 2020 20:38:04 +0000 (UTC) (envelope-from gordon@tetlows.org) Received: from mail-vs1-xe34.google.com (mail-vs1-xe34.google.com [IPv6:2607:f8b0:4864:20::e34]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4B2p0C6Xfcz4bRc for ; Thu, 9 Jul 2020 20:38:03 +0000 (UTC) (envelope-from gordon@tetlows.org) Received: by mail-vs1-xe34.google.com with SMTP id j186so1810514vsd.10 for ; Thu, 09 Jul 2020 13:38:03 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=UBfYFy84dF+jOxSvT+y2bKHO+1zBmAtLlB/Br/CroHs=; b=uFhOP1csvSWBb/vRoVLORzjSPSyp5pAya1mCa0NEZ99lRo0llyEHlpleY8ueU5kUrP Ys060SdAHW7p8I98OD5voXHmVHYbf+/MUzInqrUrEo45FbbxyvNK+xJqdaFbyFyxkC4N HKpzRKUx9ZS17gnD60zmUhWYkr8bCslXG9rVdwmPY51cSkt7OZA1xboTEVwq74mCDxCy FOPmOp/8SEydl+OHIZDj/39Ozs1W5obnvNsykc1utbovdUtvv8olzoog+vrV4BdXD7Ye sZl6PY9BR/AMzBG0pEu8Rvr+FkilQeq1KzVVcVuzhMbxhaPYb9cLskv4/PUbJdHTsO+P oAig== X-Gm-Message-State: AOAM532M6lBq26+P0hoSFK5mVdYDscW08SN9BCcyRD+9WpDW8SqjxXwm lf8qC55ponIlapDQMaQBLGkhzUMr+BG7QZOwJ+KS X-Google-Smtp-Source: ABdhPJwVvrKDlnIPWYdLSNVe7NEcHDmvE2uFbt/v5HHleo2nK6cHA4ZK+NhW653eI8eN1qzkO2NOsBVMvjdpCg+WQwA= X-Received: by 2002:a67:6fc7:: with SMTP id k190mr43591941vsc.84.1594327082572; Thu, 09 Jul 2020 13:38:02 -0700 (PDT) MIME-Version: 1.0 References: <20200708210700.280D517D45@freefall.freebsd.org> In-Reply-To: From: Gordon Tetlow Date: Thu, 9 Jul 2020 13:37:51 -0700 Message-ID: Subject: Re: FreeBSD Security Advisory FreeBSD-SA-20:19.unbound To: Craig Leres Cc: "freebsd-hackers@freebsd.org" Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 4B2p0C6Xfcz4bRc X-Spamd-Bar: --- X-Spamd-Result: default: False [-3.45 / 15.00]; TO_DN_EQ_ADDR_SOME(0.00)[]; ARC_NA(0.00)[]; R_DKIM_ALLOW(-0.20)[tetlows.org:s=google]; NEURAL_HAM_MEDIUM(-1.00)[-0.996]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36]; NEURAL_HAM_LONG(-1.02)[-1.017]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-hackers@freebsd.org]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[tetlows.org:+]; RCPT_COUNT_TWO(0.00)[2]; RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::e34:from]; NEURAL_HAM_SHORT(-0.44)[-0.437]; DMARC_POLICY_ALLOW(-0.50)[tetlows.org,quarantine]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[] X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Jul 2020 20:38:04 -0000 On Thu, Jul 9, 2020 at 10:02 AM Craig Leres wrote: > > After upgrading to 11.3-RELEASE-p11 I find that my systems still think > they can upgrade to -p11. But the files to be installed aren't. > > zinc 12 # freebsd-version > 11.3-RELEASE-p11 > zinc 13 # freebsd-update fetch > Looking up update5.freebsd.org mirrors... none found. > Fetching metadata signature for 11.3-RELEASE from > update5.freebsd.org... done. > Fetching metadata index... done. > Inspecting system... done. > Preparing to download files... done. > The following files will be added as part of updating to > 11.3-RELEASE-p11: > /usr/lib/debug/usr/sbin/local-unbound-anchor.debug > /usr/lib/debug/usr/sbin/local-unbound-checkconf.debug > /usr/lib/debug/usr/sbin/local-unbound-control.debug > /usr/lib/debug/usr/sbin/local-unbound.debug > zinc 14 # freebsd-update install > Installing updates...install: > ///usr/lib/debug/usr/sbin/local-unbound-anchor.debug: No such file or > directory > install: ///usr/lib/debug/usr/sbin/local-unbound-checkconf.debug: > No such file or directory > install: ///usr/lib/debug/usr/sbin/local-unbound-control.debug: No > such file or directory > install: ///usr/lib/debug/usr/sbin/local-unbound.debug: No such > file or directory > done. > > Should I create /usr/lib/debug/usr/sbin and update again? Ignoring it is > not a good option because I have a cron job to "freebsd-update fetch". I would give that a try. Those files are part of the "base-dbg" package. Are you expecting that to be installed on this host? Note, I hope you are using "freebsd-update cron" in your cron. Best, Gordon From owner-freebsd-hackers@freebsd.org Thu Jul 9 21:26:54 2020 Return-Path: Delivered-To: freebsd-hackers@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B91FB356E33 for ; Thu, 9 Jul 2020 21:26:54 +0000 (UTC) (envelope-from asomers@gmail.com) Received: from mail-oo1-f50.google.com (mail-oo1-f50.google.com [209.85.161.50]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4B2q4Y6mqvz4fNC for ; Thu, 9 Jul 2020 21:26:53 +0000 (UTC) (envelope-from asomers@gmail.com) Received: by mail-oo1-f50.google.com with SMTP id o36so609872ooi.11 for ; Thu, 09 Jul 2020 14:26:53 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=2WPGsz5MrRFAiGX++hgmlY7WkBbPwOgUEKbdoMYW7rQ=; b=MNgM5ZO45e7jaYINPfivWWjxx6UAnXtZtqpOf12yJybZMU8ZDmSdjcJlxubcqPXjf4 aM4izifWKnn+uvzo+FiVotDQgI/XPt8pQhfoC95B4DnXmbgJgytLe20cNQNnjXhvz+EG naZNJZ8QYg7PPXm0oWh+e9Dkezk1YSFdUahupQVDcjTJ0uhKkL1Ebpq68XzzwhYDCFZX b55PC/boeo3jZouqjAE6eN7auyxSKdkfsObDo39hgXu9+he4XDoh0zxHwbsQG82MoCjP gW48Q7AAClPu71POAe1BDaGULD6DkH3XVxvh29NvtzRpO3mJgt3B2+x/D0uKGciFyQTu BIQg== X-Gm-Message-State: AOAM533+9Xx8BpP/5VMlNCm/WLGDoUqO8a3qLLKMzE18gwZWA+bKivE6 WVk0ZC6ZzRktzYBFUk7y+gqZWxnvB92A4wolDhexYBH+wxM= X-Google-Smtp-Source: ABdhPJzny1L5oLZ3e2LXa5jHg32lwOlWu3ncMECuiVZqjym0W+z6nMhcNYROt4eKih10BOg4hi7aeM1jy8j4+hAaGaY= X-Received: by 2002:a4a:2a41:: with SMTP id x1mr57377327oox.79.1594330012234; Thu, 09 Jul 2020 14:26:52 -0700 (PDT) MIME-Version: 1.0 From: Alan Somers Date: Thu, 9 Jul 2020 15:26:41 -0600 Message-ID: Subject: Right-sizing the geli thread pool To: FreeBSD Hackers X-Rspamd-Queue-Id: 4B2q4Y6mqvz4fNC X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of asomers@gmail.com designates 209.85.161.50 as permitted sender) smtp.mailfrom=asomers@gmail.com X-Spamd-Result: default: False [0.45 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-0.55)[-0.549]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[]; FROM_HAS_DN(0.00)[]; RWL_MAILSPIKE_GOOD(0.00)[209.85.161.50:from]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17:c]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-hackers@freebsd.org]; DMARC_NA(0.00)[freebsd.org]; RCPT_COUNT_ONE(0.00)[1]; TO_DN_ALL(0.00)[]; NEURAL_SPAM_LONG(0.18)[0.180]; RCVD_IN_DNSWL_NONE(0.00)[209.85.161.50:from]; NEURAL_SPAM_SHORT(0.82)[0.822]; FORGED_SENDER(0.30)[asomers@freebsd.org,asomers@gmail.com]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:~]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; FROM_NEQ_ENVFROM(0.00)[asomers@freebsd.org,asomers@gmail.com]; FREEMAIL_ENVFROM(0.00)[gmail.com]; TO_DOM_EQ_FROM_DOM(0.00)[] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.33 X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Jul 2020 21:26:54 -0000 Currently, geli creates a separate thread pool for each provider, and by default each thread pool contains one thread per cpu. On a large server with many encrypted disks, that can balloon into a very large number of threads! I have a patch in progress that switches from per-provider thread pools to a single thread pool for the entire module. Happily, I see read IOPs increase by up to 60%. But to my surprise, write IOPs _decreases_ by up to 25%. dtrace suggests that the CPU usage is dominated by the vmem_free call in biodone, as in the below stack. kernel`lock_delay+0x32 kernel`biodone+0x88 kernel`g_io_deliver+0x214 geom_eli.ko`g_eli_write_done+0xf6 kernel`g_io_deliver+0x214 kernel`md_kthread+0x275 kernel`fork_exit+0x7e kernel`0xffffffff8104784e I only have one idea for how to improve things from here. The geli thread pool is still fed by a single global bio queue. That could cause cache thrashing, if bios get moved between cores too often. I think a superior design would be to use a separate bio queue for each geli thread, and use work-stealing to balance them. However, 1) That doesn't explain why this change benefits reads more than writes, and 2) work-stealing is hard to get right, and I can't find any examples in the kernel. Can anybody offer tips or code for implementing work stealing? Or any other suggestions about why my write performance is suffering? I would like to get this change committed, but not without resolving that issue. -Alan From owner-freebsd-hackers@freebsd.org Thu Jul 9 22:55:53 2020 Return-Path: Delivered-To: freebsd-hackers@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C7358358B90 for ; Thu, 9 Jul 2020 22:55:53 +0000 (UTC) (envelope-from leres@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4B2s3F4ty7z3Wfc; Thu, 9 Jul 2020 22:55:53 +0000 (UTC) (envelope-from leres@freebsd.org) Received: from ice.alameda.xse.com (unknown [IPv6:2600:1700:a570:11f0:f2ad:4eff:fe0b:a065]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: leres) by smtp.freebsd.org (Postfix) with ESMTPSA id 4615125D5C; Thu, 9 Jul 2020 22:55:53 +0000 (UTC) (envelope-from leres@freebsd.org) Subject: Re: FreeBSD Security Advisory FreeBSD-SA-20:19.unbound To: Gordon Tetlow References: <20200708210700.280D517D45@freefall.freebsd.org> Cc: "freebsd-hackers@freebsd.org" From: Craig Leres Message-ID: Date: Thu, 9 Jul 2020 15:55:52 -0700 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Jul 2020 22:55:53 -0000 On 2020-07-09 11:37, Gordon Tetlow wrote: > I would give that a try. Those files are part of the "base-dbg" > package. Are you expecting that to be installed on this host? That's helpful. freebsd-update.conf has: Components src world without kernel because I always build custom. Does that imply base-dbg? I'm pretty sure I didn't select base-dbg when I installed this system. Can I fix this by changing my Components line. Maybe this? Components src/src world/base I looked at freebsd-update, the related man pages and the FreeBSD handbook and don't see a comprehensive list of components. I just tried running this: zinc 55 # freebsd-update -r 12.1-RELEASE upgrade Looking up update5.freebsd.org mirrors... none found. Fetching metadata signature for 11.3-RELEASE from update5.freebsd.org... done. Fetching metadata index... done. Fetching 1 metadata patches. done. Applying metadata patches... done. Inspecting system... done. The following components of FreeBSD seem to be installed: src/src world/base The following components of FreeBSD do not seem to be installed: world/base-dbg world/doc world/lib32 world/lib32-dbg Does this look reasonable (y/n)? ^C It doesn't appear to be that freebsd-update believes I have world/base-dbg installed? > Note, I hope you are using "freebsd-update cron" in your cron. I run it in a wrapper script that only sends email when the output changes but essentially I'm doing this: sleep `jot -r 1 0 3600` ; freebsd-update --not-running-from-cron fetch So the same load balancing. Craig From owner-freebsd-hackers@freebsd.org Fri Jul 10 01:49:48 2020 Return-Path: Delivered-To: freebsd-hackers@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DD19535BA2D for ; Fri, 10 Jul 2020 01:49:48 +0000 (UTC) (envelope-from rwmaillists@googlemail.com) Received: from mail-wm1-x341.google.com (mail-wm1-x341.google.com [IPv6:2a00:1450:4864:20::341]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4B2wvv5vVQz3fT2 for ; Fri, 10 Jul 2020 01:49:47 +0000 (UTC) (envelope-from rwmaillists@googlemail.com) Received: by mail-wm1-x341.google.com with SMTP id o2so3987900wmh.2 for ; Thu, 09 Jul 2020 18:49:47 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:subject:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=PasRErdRaDk4fzXVvlBM2j0qp8GOoypJcBkqNSQ0Oew=; b=gBAmRZ3RsFZsQLwzE6jqJZmALKQnu9XPOY9nd4BOKuvArgQfzcvfpm0ctU3Sm1mUBB gT8nXETVzCQStZWc3bmKgET0oqhTMnjPGYs3mXg+uoPlbwtL4+6VsEqzIIiLP/A/vavR OMIZ0DoOZuFhIw1MZcrsbEjsITSfSJgSUw3u5U8h7Rup6K7boZv79eE7dsRPRvQzJfce Rfi/JrVZXmiAZo5FRiqWZO+0EiYLslNDo6iyy21Hx1qmIkfsofCoSeprt2Us9kg6j2il J4yk/NyCCeLYnWoaSB3hIIjhr62JHsAUKTjxVWLsd3kplu/F26gIdJfMsmwy2PJmqJOD HTpg== X-Gm-Message-State: AOAM532riOWTOMWbZYcNii5+c/iINyR0nv0De3br8U0BBok8ZT5otHEk GTMWzZexiJj+x5yikZY5Az95xA6N X-Google-Smtp-Source: ABdhPJzwzu7e21sNa5/cNrrjFp239ktkJlEyU06bNSmvGS/asWmRr7S1xouAUhAt4umW2T+ib/vynA== X-Received: by 2002:a7b:cd07:: with SMTP id f7mr2507326wmj.115.1594345785596; Thu, 09 Jul 2020 18:49:45 -0700 (PDT) Received: from gumby.homeunix.com ([2.219.100.242]) by smtp.gmail.com with ESMTPSA id n14sm7982699wro.81.2020.07.09.18.49.43 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 Jul 2020 18:49:44 -0700 (PDT) Date: Fri, 10 Jul 2020 02:49:42 +0100 From: RW To: freebsd-hackers@freebsd.org Subject: Re: FreeBSD Security Advisory FreeBSD-SA-20:19.unbound Message-ID: <20200710024942.5fc992fa@gumby.homeunix.com> In-Reply-To: References: <20200708210700.280D517D45@freefall.freebsd.org> X-Mailer: Claws Mail 3.17.5 (GTK+ 2.24.32; amd64-portbld-freebsd12.1) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 4B2wvv5vVQz3fT2 X-Spamd-Bar: --- X-Spamd-Result: default: False [-3.49 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; ARC_NA(0.00)[]; R_DKIM_ALLOW(-0.20)[googlemail.com:s=20161025]; RECEIVED_SPAMHAUS_PBL(0.00)[2.219.100.242:received]; FROM_HAS_DN(0.00)[]; FREEMAIL_FROM(0.00)[googlemail.com]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-hackers@freebsd.org]; TO_DN_NONE(0.00)[]; RCPT_COUNT_ONE(0.00)[1]; NEURAL_HAM_LONG(-1.04)[-1.041]; RCVD_COUNT_THREE(0.00)[3]; NEURAL_HAM_MEDIUM(-0.95)[-0.946]; R_SPF_ALLOW(-0.20)[+ip6:2a00:1450:4000::/36]; DKIM_TRACE(0.00)[googlemail.com:+]; DMARC_POLICY_ALLOW(-0.50)[googlemail.com,quarantine]; RCVD_IN_DNSWL_NONE(0.00)[2a00:1450:4864:20::341:from]; NEURAL_HAM_SHORT(-0.50)[-0.504]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[googlemail.com]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US]; RCVD_TLS_ALL(0.00)[]; DWL_DNSWL_NONE(0.00)[googlemail.com:dkim] X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Jul 2020 01:49:48 -0000 On Thu, 9 Jul 2020 15:55:52 -0700 Craig Leres wrote: > On 2020-07-09 11:37, Gordon Tetlow wrote: > > I would give that a try. Those files are part of the "base-dbg" > > package. Are you expecting that to be installed on this host? > > That's helpful. freebsd-update.conf has: > > Components src world > > without kernel because I always build custom. Does that imply > base-dbg? I'm pretty sure I didn't select base-dbg when I installed > this system. A "base-dbg" *package* would be part of a packaged based system updated by pkg. freebsd-update doesn't work with packages. From owner-freebsd-hackers@freebsd.org Fri Jul 10 03:34:34 2020 Return-Path: Delivered-To: freebsd-hackers@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BE29835D8AF for ; Fri, 10 Jul 2020 03:34:34 +0000 (UTC) (envelope-from jpaetzel@FreeBSD.org) Received: from forward4-smtp.messagingengine.com (forward4-smtp.messagingengine.com [66.111.4.238]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4B2zDp3806z42Gd; Fri, 10 Jul 2020 03:34:34 +0000 (UTC) (envelope-from jpaetzel@FreeBSD.org) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailforward.nyi.internal (Postfix) with ESMTP id 7E8C3194285D; Thu, 9 Jul 2020 23:34:33 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Thu, 09 Jul 2020 23:34:33 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm3; bh=HDBlpxvSDXhnoqEhgS30QQQ3XpagxHHYObClVmlQq dM=; b=Z0PfKfYLZa/wIO2ARRt+4MJVCBXlOSI0/5RpF2T5p5vTBM+l1rLc5RcSt f1aKhliYFXonoA+vdzhKoVOUewaq4MQclGOVolrLDiPm2brGYTlWGJ/2M84FQtaS Ljvy4UmzoZjxIUXFREUSVTX9wnVs0WPVsA6CPPNi05ghjSaP1bt3Gddp+VGg/QRv uKtrh425pnRMW+53DbwbJ3xe5jhr31O+c1nYwtC8iv+Q22Dz6GOG8aIVCaV12QK1 bU59yST13DTg7xgO/fv9/hBSeucHNIZks5kpe/WTUAgJOsQm9qwRw2dsgbQkDB0h NG0hghxUdik1PwCpNdsgHMaOQMxTQ== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduiedrvddtgdejvdcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpegtgffhggfufffkfhgjvffosehtqhhmtdhhtdejnecuhfhrohhmpeflohhshhcu rfgrvghtiigvlhcuoehjphgrvghtiigvlheshfhrvggvuefuffdrohhrgheqnecuggftrf grthhtvghrnhepvdejveffkefguedtffehueeihfelgeeuvddvffehjeevkeejffeiiedt heduieegnecukfhppedukeegrdeljedruddvtddruddvkeenucevlhhushhtvghrufhiii gvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehjphgrvghtiigvlheshfhrvggvuefu ffdrohhrgh X-ME-Proxy: Received: from [192.168.133.203] (unknown [184.97.120.128]) by mail.messagingengine.com (Postfix) with ESMTPA id 014D030600B7; Thu, 9 Jul 2020 23:34:33 -0400 (EDT) Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable From: Josh Paetzel Mime-Version: 1.0 (1.0) Subject: Re: Right-sizing the geli thread pool Date: Thu, 9 Jul 2020 22:34:30 -0500 Message-Id: <49D059B5-9A35-4EB5-9811-AFB024DA0566@FreeBSD.org> References: Cc: FreeBSD Hackers In-Reply-To: To: Alan Somers X-Mailer: iPhone Mail (17F80) X-Rspamd-Queue-Id: 4B2zDp3806z42Gd X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:11403, ipnet:66.111.4.0/24, country:US] X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Jul 2020 03:34:34 -0000 >=20 > On Jul 9, 2020, at 4:27 PM, Alan Somers wrote: >=20 > =EF=BB=BFCurrently, geli creates a separate thread pool for each provider,= and by > default each thread pool contains one thread per cpu. On a large server > with many encrypted disks, that can balloon into a very large number of > threads! I have a patch in progress that switches from per-provider threa= d > pools to a single thread pool for the entire module. Happily, I see read > IOPs increase by up to 60%. But to my surprise, write IOPs _decreases_ by= > up to 25%. dtrace suggests that the CPU usage is dominated by the > vmem_free call in biodone, as in the below stack. >=20 > kernel`lock_delay+0x32 > kernel`biodone+0x88 > kernel`g_io_deliver+0x214 > geom_eli.ko`g_eli_write_done+0xf6 > kernel`g_io_deliver+0x214 > kernel`md_kthread+0x275 > kernel`fork_exit+0x7e > kernel`0xffffffff8104784e >=20 > I only have one idea for how to improve things from here. The geli thread= > pool is still fed by a single global bio queue. That could cause cache > thrashing, if bios get moved between cores too often. I think a superior > design would be to use a separate bio queue for each geli thread, and use > work-stealing to balance them. However, >=20 > 1) That doesn't explain why this change benefits reads more than writes, a= nd > 2) work-stealing is hard to get right, and I can't find any examples in th= e > kernel. >=20 > Can anybody offer tips or code for implementing work stealing? Or any > other suggestions about why my write performance is suffering? I would > like to get this change committed, but not without resolving that issue. >=20 > -Alan > __ Alan, Several years ago I spent a bunch of time optimizing geli+ZFS performance. Nothing as ambitious as what you are doing though. I have some hand wavy theories about the write performance and how cache thr= ash would be more expensive for writes than reads. The default configuratio= n is essentially pathological for systems with large amounts of disks. But t= hat doesn=E2=80=99t really explain why your change drops performance. Howev= er I=E2=80=99ll send you over some dtrace stuff I have at work tomorrow. It=E2= =80=99s pretty sophisticated and should let you visualize the entire I/O pip= eline. (You=E2=80=99ll have to add the geli part) What I discovered is without a histogram based auto tuner it was not possibl= e to tune for optimal performance for dynamic workloads. As to your question about work stealing. I=E2=80=99ve got nothing there. Thanks, Josh Paetzel FreeBSD - The Power to Serve From owner-freebsd-hackers@freebsd.org Fri Jul 10 03:55:55 2020 Return-Path: Delivered-To: freebsd-hackers@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 650E935E0E3 for ; Fri, 10 Jul 2020 03:55:55 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: from mail-wm1-x344.google.com (mail-wm1-x344.google.com [IPv6:2a00:1450:4864:20::344]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4B2zjR0HnRz43m6; Fri, 10 Jul 2020 03:55:54 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: by mail-wm1-x344.google.com with SMTP id o2so4227348wmh.2; Thu, 09 Jul 2020 20:55:54 -0700 (PDT) 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=4Gc7S+RLsCDgmOn98j4FEMke/HnZGJQVgU9jtgVn7GA=; b=IphF7AI92Y2JPBbYqi0iE02c/o3OD1X8E76kE0+Bf+WPIGly2X/pomeKO6C8alnds7 CjmKOf7Xxo6gpkfdf6GNT3ZGk884uB4qxYAmGtU6JftNhsxrKo6D6vmqZlFfJy6Np6Ke +R7z0ZHshDjbKnjD20NYhUnCqDWUiswb2kjLpjjjx9SMEvi6FQKLHYFt/PkRzLna+OlQ djjPL0ATlR893LclwmMKb4Hk4Tzn1ncm/BuheqB4KtfZ3BM5t7c6tYLlq9gtKywh6C9o jdhNuMF8AI7NBhXajQ0mJ+GYJtxTsFwT0eGqyTplOEB1JLkX2qlBhJq+LA9YbstNi9wE bGNQ== 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=4Gc7S+RLsCDgmOn98j4FEMke/HnZGJQVgU9jtgVn7GA=; b=ZSMRqEsrNCi+bOwLwZ64kCQGa1Kz3OmSiX5+TfECqrEXPoiY0HBqeTxMDSYHnk1/8t V+SifzQpJMXWvzu41g/9yZ204g+DSZrv2ds8Feph07GEczRaTn/JuaglTPnNCflC7ZV3 7aeqNk5kXX3U/guwFae2qG8F3V4sa4zum9o9+WkqklPxydagqNsbkLFJvsaym49qx34x RKuIUpQRkogidDwiJcVmDULAwPLEvyPgX/pZZNtAQo4YDljoO5/i820Tnjdr9kK93KrP ti8wJm3sfbu83ihcYDvBhpqxKVNPER9AcPumKeOlhgFPWECMq+Agh0jXF2tMkEGi3UT1 UqTg== X-Gm-Message-State: AOAM531IfvtBbWwhiGvC035ARwkGQldXwqJaIJ0P7CyMl8nh69hf+1D+ Iqs6oyP+XsNpMqBHhnmUDiH322bmw2D1kFYaoT9G6Q== X-Google-Smtp-Source: ABdhPJwyrZTACn8Dy1JrfAQgjpgTPQ0V9QKFaIadT1mQgjGyqjxQ5rabh+hjs13X+hsLPZmnCsLPY9D1Q9eG/wzxeik= X-Received: by 2002:a05:600c:2209:: with SMTP id z9mr2997975wml.178.1594353351941; Thu, 09 Jul 2020 20:55:51 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a5d:43cf:0:0:0:0:0 with HTTP; Thu, 9 Jul 2020 20:55:50 -0700 (PDT) In-Reply-To: References: From: Mateusz Guzik Date: Fri, 10 Jul 2020 05:55:50 +0200 Message-ID: Subject: Re: Right-sizing the geli thread pool To: Alan Somers Cc: FreeBSD Hackers Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 4B2zjR0HnRz43m6 X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US] X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Jul 2020 03:55:55 -0000 On 7/9/20, Alan Somers wrote: > Currently, geli creates a separate thread pool for each provider, and by > default each thread pool contains one thread per cpu. On a large server > with many encrypted disks, that can balloon into a very large number of > threads! I have a patch in progress that switches from per-provider thread > pools to a single thread pool for the entire module. Happily, I see read > IOPs increase by up to 60%. But to my surprise, write IOPs _decreases_ by > up to 25%. dtrace suggests that the CPU usage is dominated by the > vmem_free call in biodone, as in the below stack. > > kernel`lock_delay+0x32 > kernel`biodone+0x88 > kernel`g_io_deliver+0x214 > geom_eli.ko`g_eli_write_done+0xf6 > kernel`g_io_deliver+0x214 > kernel`md_kthread+0x275 > kernel`fork_exit+0x7e > kernel`0xffffffff8104784e > > I only have one idea for how to improve things from here. The geli thread > pool is still fed by a single global bio queue. That could cause cache > thrashing, if bios get moved between cores too often. I think a superior > design would be to use a separate bio queue for each geli thread, and use > work-stealing to balance them. However, > > 1) That doesn't explain why this change benefits reads more than writes, > and > 2) work-stealing is hard to get right, and I can't find any examples in the > kernel. > > Can anybody offer tips or code for implementing work stealing? Or any > other suggestions about why my write performance is suffering? I would > like to get this change committed, but not without resolving that issue. > I can't comment on revamping the design, but: void vmem_free(vmem_t *vm, vmem_addr_t addr, vmem_size_t size) { qcache_t *qc; MPASS(size > 0); if (size <= vm->vm_qcache_max && __predict_true(addr >= VMEM_ADDR_QCACHE_MIN)) { qc = &vm->vm_qcache[(size - 1) >> vm->vm_quantum_shift]; uma_zfree(qc->qc_cache, (void *)addr); } else vmem_xfree(vm, addr, size); } What sizes are being passed here? Or more to the point, is it feasible to bump qcache to stick to uma in this call? If lock contention is indeed coming from vmem_xfree this change would get rid of the problem without having to rework anything. For read performance, while it is nice there is a win, it may still be less than it should. I think it is prudent to get a flamegraph from both cases. -- Mateusz Guzik From owner-freebsd-hackers@freebsd.org Fri Jul 10 07:22:40 2020 Return-Path: Delivered-To: freebsd-hackers@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 94F3A36146F for ; Fri, 10 Jul 2020 07:22:40 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: from mail-wm1-x341.google.com (mail-wm1-x341.google.com [IPv6:2a00:1450:4864:20::341]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4B34Hz45DWz4F9t for ; Fri, 10 Jul 2020 07:22:39 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: by mail-wm1-x341.google.com with SMTP id j18so4896690wmi.3 for ; Fri, 10 Jul 2020 00:22:39 -0700 (PDT) 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=adIeQdLhfzA9h7CwjQ2V6pySJMjWRl0QGeCbmDvuSls=; b=BioQlFB2xLk7pRZ7KaaVXdqrHa5AES5uTWO+tTM8QiVmqj9Ndlwsml7F3GgIVyqpxM YmhAg4p/Gf3P0TVK8Fl4WjYwoO/eh8kkmYK/AJJAUVCowQKdUK94ug4X3AoHlrJIt+iE Hxw5F+9UM5V5dwrIhYOzWmIqdN+VTrj0Tpk0dYgEDWHqgupwOcEFzvAIqxLC8rzQQeRM ELg2jpUTYGrT9pMOtO5bKj4OxcSzz//Femdf81GLkeuss5NkMLkl71F7dOS955GFKtVb acX4aWFB4fK+vzrrZPBjaYZ/iG7K4+tU8/ZjgVtZ4utLg1Of5XgAEayyHWFEVRGoi82c xinQ== 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=adIeQdLhfzA9h7CwjQ2V6pySJMjWRl0QGeCbmDvuSls=; b=Js29yDepgc9LHERWvZ1503CFm5K+XnN/GvhN5xgx6etGl6AL1CE69CG8dMkBx0I6oK AmttTXWOMtA0J6Xp+zagRLjBwFWUGJa0W3OkzJqbTWtKGCLf9X9D3M28jlI2gzbRqdh+ bprQi4AmvWcGxuKunlm3f5cG/6XzWgN/au5sSOQaPZrgC1X75E6JRw1Jn+B1yCEAmeLa rF1EoZQUyS/r0iD62k0cxiJpPns/eGKdx1h7earGzxUm4JF5AZY/42jCWxiMl/3ajp4T MqGFzaJPXQ8NWV42gQ1YIr9SAPsF78Z20aotgOixO8g7N1T5rBEVa5K3WJC24vyHlsGO g3yA== X-Gm-Message-State: AOAM532RNObw5LXspx8i1y5wyhPnqP8OIChabNjQ1pXdgeY1Cd9vWj8l cMs5VinY6tLix809NFxFxh2R11JshcniXe/4Tnc= X-Google-Smtp-Source: ABdhPJw8rpN7fiNwzHYDOlZr8btu49nUUyByq6WZsJM02ylLKEVPU6MQ1UHmY/PEjmxHSBP0FuhX1pmNZPbX5ovhftc= X-Received: by 2002:a05:600c:20d3:: with SMTP id y19mr4039988wmm.10.1594365758171; Fri, 10 Jul 2020 00:22:38 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:adf:9d84:0:0:0:0:0 with HTTP; Fri, 10 Jul 2020 00:22:37 -0700 (PDT) In-Reply-To: <21b0280d-c290-f27f-98a9-0c2242380718@rawbw.com> References: <21b0280d-c290-f27f-98a9-0c2242380718@rawbw.com> From: Mateusz Guzik Date: Fri, 10 Jul 2020 09:22:37 +0200 Message-ID: Subject: Re: Is it possible to determine the open file path based on the file descriptor? To: Yuri Cc: Freebsd hackers list Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 4B34Hz45DWz4F9t X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=BioQlFB2; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of mjguzik@gmail.com designates 2a00:1450:4864:20::341 as permitted sender) smtp.mailfrom=mjguzik@gmail.com X-Spamd-Result: default: False [-2.72 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-0.98)[-0.984]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; RCVD_TLS_ALL(0.00)[]; FROM_HAS_DN(0.00)[]; R_SPF_ALLOW(-0.20)[+ip6:2a00:1450:4000::/36:c]; FREEMAIL_FROM(0.00)[gmail.com]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-hackers@freebsd.org]; NEURAL_HAM_LONG(-1.04)[-1.037]; TO_MATCH_ENVRCPT_SOME(0.00)[]; TO_DN_ALL(0.00)[]; DKIM_TRACE(0.00)[gmail.com:+]; RCPT_COUNT_TWO(0.00)[2]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; RCVD_IN_DNSWL_NONE(0.00)[2a00:1450:4864:20::341:from]; NEURAL_HAM_SHORT(-0.70)[-0.700]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; SUBJECT_ENDS_QUESTION(1.00)[]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US]; RCVD_COUNT_TWO(0.00)[2]; FREEMAIL_ENVFROM(0.00)[gmail.com]; DWL_DNSWL_NONE(0.00)[gmail.com:dkim] X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Jul 2020 07:22:40 -0000 On 7/8/20, Yuri wrote: > Hi Hackers, > > > One of the ports (sysutils/watchman) attempts to find the path of the > file based on the file descriptor assuming that this descriptor > represents an open file. > I had a look at the program at hand. It seems to predominantly use F_GETPATH for de facto realpath, it looks like this: auto handle = openFileHandle(path, options); return handle.getOpenedPath(); That said, for this program on FreeBSD, the right thing to do is to convert it to actual realpath(3). In head this will be performant just fine as it is implemented as a syscall. I can MFC it for stable/12. -- Mateusz Guzik From owner-freebsd-hackers@freebsd.org Fri Jul 10 08:52:41 2020 Return-Path: Delivered-To: freebsd-hackers@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CF633363F6A for ; Fri, 10 Jul 2020 08:52:41 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4B36Hs1r4bz4LLq; Fri, 10 Jul 2020 08:52:40 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id 06A8qQ4j084950 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Fri, 10 Jul 2020 11:52:29 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua 06A8qQ4j084950 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id 06A8qQvw084949; Fri, 10 Jul 2020 11:52:26 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Fri, 10 Jul 2020 11:52:26 +0300 From: Konstantin Belousov To: Alan Somers Cc: FreeBSD Hackers Subject: Re: Right-sizing the geli thread pool Message-ID: <20200710085226.GC2866@kib.kiev.ua> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on tom.home X-Rspamd-Queue-Id: 4B36Hs1r4bz4LLq X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; ASN(0.00)[asn:6939, ipnet:2001:470::/32, country:US]; REPLY(-4.00)[] X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Jul 2020 08:52:41 -0000 On Thu, Jul 09, 2020 at 03:26:41PM -0600, Alan Somers wrote: > Currently, geli creates a separate thread pool for each provider, and by > default each thread pool contains one thread per cpu. On a large server > with many encrypted disks, that can balloon into a very large number of > threads! I have a patch in progress that switches from per-provider thread > pools to a single thread pool for the entire module. Happily, I see read > IOPs increase by up to 60%. But to my surprise, write IOPs _decreases_ by > up to 25%. dtrace suggests that the CPU usage is dominated by the > vmem_free call in biodone, as in the below stack. > > kernel`lock_delay+0x32 > kernel`biodone+0x88 > kernel`g_io_deliver+0x214 > geom_eli.ko`g_eli_write_done+0xf6 > kernel`g_io_deliver+0x214 > kernel`md_kthread+0x275 > kernel`fork_exit+0x7e > kernel`0xffffffff8104784e > > I only have one idea for how to improve things from here. The geli thread > pool is still fed by a single global bio queue. That could cause cache > thrashing, if bios get moved between cores too often. I think a superior > design would be to use a separate bio queue for each geli thread, and use > work-stealing to balance them. However, Geli uses mapped io, and the fact that vmem_free() is called from biodone() means that geom has to enable transient remapping to handle unmapped requests coming to geli provider. This path was never supposed to be fast. Geli might need an access to the bio's data e.g. for AES-NI processing, or rather, crypto(9) aesni driver needs it. But it might be very beneficial to declare geli as supporting unmapped io and only do transient remapping on pinned thread to avoid global allocations of KVA and shootdowns. Another possible huge optimization could be in aesni crypto(9) driver. I am not sure what is the state of crypto(9) WRT unmapped requests, there were a lot of work improving the framework so it might support unmapped. On amd64 aesni can work with unmapped requests through DMAP, which means that no remapping is needed. > > 1) That doesn't explain why this change benefits reads more than writes, and > 2) work-stealing is hard to get right, and I can't find any examples in the > kernel. > > Can anybody offer tips or code for implementing work stealing? Or any > other suggestions about why my write performance is suffering? I would > like to get this change committed, but not without resolving that issue. > > -Alan > _______________________________________________ > 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" From owner-freebsd-hackers@freebsd.org Fri Jul 10 12:35:02 2020 Return-Path: Delivered-To: freebsd-hackers@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1801C368E0A for ; Fri, 10 Jul 2020 12:35:02 +0000 (UTC) (envelope-from se@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4B3CDP6v6fz4Yj1; Fri, 10 Jul 2020 12:35:01 +0000 (UTC) (envelope-from se@freebsd.org) Received: from Stefans-MBP-WLAN.fritz.box (p200300cd5f0bb900bc86521febb2afc9.dip0.t-ipconnect.de [IPv6:2003:cd:5f0b:b900:bc86:521f:ebb2:afc9]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: se/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 82F602CC69; Fri, 10 Jul 2020 12:35:01 +0000 (UTC) (envelope-from se@freebsd.org) To: FreeBSD Hackers From: =?UTF-8?Q?Stefan_E=c3=9fer?= Subject: Huge mergeinfo list after merge from vendor branch Autocrypt: addr=se@freebsd.org; keydata= mQENBFVxiRIBCADOLNOZBsqlplHUQ3tG782FNtVT33rQli9EjNt2fhFERHIo4NxHlWBpHLnU b0s4L/eItx7au0i7Gegv01A9LUMwOnAc9EFAm4EW3Wmoa6MYrcP7xDClohg/Y69f7SNpEs3x YATBy+L6NzWZbJjZXD4vqPgZSDuMcLU7BEdJf0f+6h1BJPnGuwHpsSdnnMrZeIM8xQ8PPUVQ L0GZkVojHgNUngJH6e21qDrud0BkdiBcij0M3TCP4GQrJ/YMdurfc8mhueLpwGR2U1W8TYB7 4UY+NLw0McThOCLCxXflIeF/Y7jSB0zxzvb/H3LWkodUTkV57yX9IbUAGA5RKRg9zsUtABEB AAG0J1N0ZWZhbiBFw59lciAoRnJlZUJTRCkgPHNlQGZyZWVic2Qub3JnPokBVAQTAQoAPgIb AwULCQgHAwUVCgkICwUWAwIBAAIeAQIXgBYhBKNx6mWcC+zIK3FTE0frte9a/fVEBQJa8u+q BQkLJQETAAoJEEfrte9a/fVEOeMH/icmdK1eZQvB3U8quJo9VMaZsaTuCMbUE4NThyfsIvIm MCd+rb/yULmMYwqNfjyKB1x4ikR4x+94l+yJoz7K0Usks+eNKDmMGJM6pWWssTigaJubFdVd hVVC+C1QJi7JshYSib08uONoPmO4lv5Az0TDYGtsMzsES2sIlc62c9go5WPGYhQFRbX3Lk6y V6m8OHh+G9XGSj3oPO4UteRwu+SzTdOLunZBWG1wu34+IeZm663D+2gOppQLWpLa2qaTerqw THu377ayZ2B2LPJ5JkvkZeHYPkwDQ+b5PGn0UhfkxPnDVYki5F7qKxvQ5uq1/q9YaCX7mmOl H2yO7tgVsrW5AQ0EVXGJEgEIALEj9qCXMZVucjpcd3QxM/TlUr98m5viEd1z4tCnPUyRWcIC EVtj2h5xMH+2iB0q1+KWhq+NsWtvScmEmfHnsr7dJ1K677OdpDhKVaJk61eeRulFY1R4yb6C 1MMxK+WgYB+vvpG0UeyR0M4uBewcPvRsq4yGUHFQKtLAbMdoPTSryJA+ElnmK1vdY+rPcHgi OIMBZM7ahsPXC0C9K4e5SP9clGyIoMpbfHXdx9q+Rp3zVtlbhyk3BS/xccu/+9pk9ICXL6GR js2sNnJ0wxdU1DsAlC59a5MnSruwiZFwRnkQhr3x6wk97Lg7sLS9jjTnCN7LGlVmSmpOEMy6 uq1AWfUAEQEAAYkBPAQYAQoAJgIbDBYhBKNx6mWcC+zIK3FTE0frte9a/fVEBQJa8u+rBQkL JQEZAAoJEEfrte9a/fVEuesH/2DNxGWnHvWwMyiyhlQtafvDKwEn/wAgR8gHJFodB7emf8rA TnukH7MVttCoHtjN5lvv9RSBHjNTZls5wR/ANlwdRuPQHd8ZGxLe3S6IuUB3zDSwFltLGurO N2kOMhs5mTGyypSa+uw3rtQbUAVYf1oPbiR4FLtiM8FLyEvE95hX5fPq9Qvx9FmN79kmCIEw jDKPqDaUf/OR2fEF0LSIbXHEk4tNqCEwx5DIJ0fp5/z5UzICUAmwxyRs5O/Hre1jzPsMVyud Ml9t7UTOJGKVWwRory1PMnOFxN+iz5/d4FhYSKXF7kfMiFgol4LuWaxJRwbBrr71VGBrRy2a L1nw6Bc= Message-ID: <5de31051-6f12-5353-43a1-0456579aaa67@freebsd.org> Date: Fri, 10 Jul 2020 14:34:57 +0200 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 Content-Type: text/plain; charset=windows-1252 Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Jul 2020 12:35:02 -0000 We have gathered lots of mergeinfo junk in the source tree over the decades, but I did not know it was so bad ... I had not performed any merges for a long time and now that I have to merge from the vendor branch to contrib in -CURRENT, I'm surprised by the long mergeinfo list I got: $ svn propget svn:mergeinfo -R /usr/src/contrib/bc . - /projects/bectl/contrib/bc:336666-337662 /projects/bsd_rdma_4_9/contrib/bc:319973-326168 /projects/bsnmp-improved-ipv6-support/contrib/bc:301868 /projects/building-blocks/contrib/bc:275142-275143,275198,275297,275306-275307,275309,275311,275556,275558,275600,277445,277670,277673 /projects/clang-sparc64/contrib/bc:262258-262612 /projects/clang-trunk/contrib/bc:283596-287505 [...] /vendor/bc/dist:362987-363077 /vendor/device-tree/dist/contrib/bc:303380 /vendor/resolver/dist/contrib/bc:1540-186085 A total of 56 lines, which are not relevant to this software, except for the 3rd last line: /vendor/bc/dist:362987-363077 Before causing a mess in the repo by committing the merged sources, I'd like to know whether this is "normal" behavior, or whether I need to clean up the mergeinfo before the commit. Thanks in advance, STefan PS: The committers handbook has quite some information regarding this kind of merge, but it makes me think that only the relevant mergeinfo line should have been registered ... From owner-freebsd-hackers@freebsd.org Fri Jul 10 16:40:55 2020 Return-Path: Delivered-To: freebsd-hackers@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4DF2036D874 for ; Fri, 10 Jul 2020 16:40:55 +0000 (UTC) (envelope-from freebsd-rwg@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4B3Jh66FSqz4pm6; Fri, 10 Jul 2020 16:40:54 +0000 (UTC) (envelope-from freebsd-rwg@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (localhost [127.0.0.1]) by gndrsh.dnsmgr.net (8.13.3/8.13.3) with ESMTP id 06AGel3o096111; Fri, 10 Jul 2020 09:40:47 -0700 (PDT) (envelope-from freebsd-rwg@gndrsh.dnsmgr.net) Received: (from freebsd-rwg@localhost) by gndrsh.dnsmgr.net (8.13.3/8.13.3/Submit) id 06AGeloK096110; Fri, 10 Jul 2020 09:40:47 -0700 (PDT) (envelope-from freebsd-rwg) From: "Rodney W. Grimes" Message-Id: <202007101640.06AGeloK096110@gndrsh.dnsmgr.net> Subject: Re: Huge mergeinfo list after merge from vendor branch In-Reply-To: <5de31051-6f12-5353-43a1-0456579aaa67@freebsd.org> To: =?UTF-8?Q?Stefan_E=C3=9Fer?= Date: Fri, 10 Jul 2020 09:40:47 -0700 (PDT) CC: FreeBSD Hackers X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Rspamd-Queue-Id: 4B3Jh66FSqz4pm6 X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:13868, ipnet:69.59.192.0/19, country:US] X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Jul 2020 16:40:55 -0000 > We have gathered lots of mergeinfo junk in the source tree over the > decades, but I did not know it was so bad ... > > > I had not performed any merges for a long time and now that I have > to merge from the vendor branch to contrib in -CURRENT, I'm surprised > by the long mergeinfo list I got: > > $ svn propget svn:mergeinfo -R /usr/src/contrib/bc > . - /projects/bectl/contrib/bc:336666-337662 > /projects/bsd_rdma_4_9/contrib/bc:319973-326168 > /projects/bsnmp-improved-ipv6-support/contrib/bc:301868 > /projects/building-blocks/contrib/bc:275142-275143,275198,275297,275306-275307,275309,275311,275556,275558,275600,277445,277670,277673 > /projects/clang-sparc64/contrib/bc:262258-262612 > /projects/clang-trunk/contrib/bc:283596-287505 > [...] > /vendor/bc/dist:362987-363077 > /vendor/device-tree/dist/contrib/bc:303380 > /vendor/resolver/dist/contrib/bc:1540-186085 > > A total of 56 lines, which are not relevant to this software, except for > the 3rd last line: > > /vendor/bc/dist:362987-363077 > > Before causing a mess in the repo by committing the merged sources, > I'd like to know whether this is "normal" behavior, or whether I need > to clean up the mergeinfo before the commit. > > Thanks in advance, STefan > > PS: The committers handbook has quite some information regarding this > kind of merge, but it makes me think that only the relevant mergeinfo > line should have been registered ... Was a merge done from the wrong working directory? Merges need to be done while cwd is the top level of the src tree. If done in a subdirectory a massive pile of unwanted mergeinfo is created. You can step back through the merge commits and see when this happened. -- Rod Grimes rgrimes@freebsd.org From owner-freebsd-hackers@freebsd.org Fri Jul 10 17:54:59 2020 Return-Path: Delivered-To: freebsd-hackers@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6180E36F42B for ; Fri, 10 Jul 2020 17:54:59 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-qv1-xf44.google.com (mail-qv1-xf44.google.com [IPv6:2607:f8b0:4864:20::f44]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4B3LKZ3mVmz4vqP; Fri, 10 Jul 2020 17:54:58 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: by mail-qv1-xf44.google.com with SMTP id h17so2986562qvr.0; Fri, 10 Jul 2020 10:54:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=blGvUMUzHaHMd0CPebItmapaxEGasp1syYXG4+rOs3o=; b=AEGXzCD24aQzlP1KIDvbKzi15v4n/XxVoBv5LiI3pDq1C/j7XvWMB81z1UVaGDa8ex Kml/Sg7xzcl3rWcQQE64hqn2+RjcHSasE/f6lsG6gVDXkwPpz5R8qWQ+tBJexRqyyO7Y 9c1o9gQj4/xM/YSpExAGvM+/IMAeOLR8XBywnUlis7psgPEDBwroh+1nIQzLgCU+5UfV YTXUJPSFTSMuU0W7NrL4fAQDP9VHt2i3R50TrwRgsDbBb4zmnfaDKdva8u5YtGqAKLEU KCIpdcWM2WOACoHyLWGPTv/mmGP5532XZrrZ08SOJfHQ1KTx/EgUuzAMy5Prfi36Pk64 Qmwg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to; bh=blGvUMUzHaHMd0CPebItmapaxEGasp1syYXG4+rOs3o=; b=ZyM0qU7M5J/crCqVsNtvZrH8SjYEsCg2rv9hPcqAIsxl1fM4l3HRm7ME/v6ki4j786 sOtgT3+fWYW2JmBwAflxPIEGZaRPZ2mU7+60KdzxLzsGQftT8ozPlYkEH3AGwlbkVA5u OHw00fwkmbWdrR/1xauomrAS7qSuoAsGZ5ztSehgWFYzv+N+bleW/Cn+KoOUgFNF50da NRjnQD/Kzm+wsd5COL1i17FzWr72c0cBmbizFzDHzCdqbRGQkEKO5x8cwpn3Q2+wUkr2 Yg83ezRXEo3RNaxErUgtVbIDkcuXhG59A+V2RIvdfrS2zYJvLibR5oc4f81Sj3GGb6TX T5lw== X-Gm-Message-State: AOAM532wROrXT3Wy9hatxuyeyXMMjeIhbgocgilufVcZnAY3QtGd0H4T g5LZGUOvYKyIfs6kwuQ2Wfo= X-Google-Smtp-Source: ABdhPJwz6J2pjwcJjf/v3EbptRaP+N6OO0llcpCt9YZcevBqh4hCW/abp9KUsYMyxv9cmUJYdO3SeA== X-Received: by 2002:a0c:b8a9:: with SMTP id y41mr56398334qvf.49.1594403697623; Fri, 10 Jul 2020 10:54:57 -0700 (PDT) Received: from raichu (toroon0560w-lp130-14-174-91-9-204.dsl.bell.ca. [174.91.9.204]) by smtp.gmail.com with ESMTPSA id f4sm8240087qtv.59.2020.07.10.10.54.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Jul 2020 10:54:57 -0700 (PDT) Sender: Mark Johnston Date: Fri, 10 Jul 2020 13:54:52 -0400 From: Mark Johnston To: Mateusz Guzik Cc: Alan Somers , FreeBSD Hackers Subject: Re: Right-sizing the geli thread pool Message-ID: <20200710175452.GA9380@raichu> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Rspamd-Queue-Id: 4B3LKZ3mVmz4vqP X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=AEGXzCD2; dmarc=none; spf=pass (mx1.freebsd.org: domain of markjdb@gmail.com designates 2607:f8b0:4864:20::f44 as permitted sender) smtp.mailfrom=markjdb@gmail.com X-Spamd-Result: default: False [-1.62 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; ARC_NA(0.00)[]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; NEURAL_HAM_MEDIUM(-0.75)[-0.755]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36]; NEURAL_HAM_LONG(-1.00)[-0.999]; MIME_GOOD(-0.10)[text/plain]; MID_RHS_NOT_FQDN(0.50)[]; DMARC_NA(0.00)[freebsd.org]; RCVD_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_SOME(0.00)[]; TO_DN_ALL(0.00)[]; DKIM_TRACE(0.00)[gmail.com:+]; NEURAL_HAM_SHORT(-0.17)[-0.167]; RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::f44:from]; FREEMAIL_TO(0.00)[gmail.com]; FORGED_SENDER(0.30)[markj@freebsd.org,markjdb@gmail.com]; RECEIVED_SPAMHAUS_PBL(0.00)[174.91.9.204:received]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; FROM_NEQ_ENVFROM(0.00)[markj@freebsd.org,markjdb@gmail.com]; RCVD_TLS_ALL(0.00)[] X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Jul 2020 17:54:59 -0000 On Fri, Jul 10, 2020 at 05:55:50AM +0200, Mateusz Guzik wrote: > On 7/9/20, Alan Somers wrote: > > Currently, geli creates a separate thread pool for each provider, and by > > default each thread pool contains one thread per cpu. On a large server > > with many encrypted disks, that can balloon into a very large number of > > threads! I have a patch in progress that switches from per-provider thread > > pools to a single thread pool for the entire module. Happily, I see read > > IOPs increase by up to 60%. But to my surprise, write IOPs _decreases_ by > > up to 25%. dtrace suggests that the CPU usage is dominated by the > > vmem_free call in biodone, as in the below stack. > > > > kernel`lock_delay+0x32 > > kernel`biodone+0x88 > > kernel`g_io_deliver+0x214 > > geom_eli.ko`g_eli_write_done+0xf6 > > kernel`g_io_deliver+0x214 > > kernel`md_kthread+0x275 > > kernel`fork_exit+0x7e > > kernel`0xffffffff8104784e > > > > I only have one idea for how to improve things from here. The geli thread > > pool is still fed by a single global bio queue. That could cause cache > > thrashing, if bios get moved between cores too often. I think a superior > > design would be to use a separate bio queue for each geli thread, and use > > work-stealing to balance them. However, > > > > 1) That doesn't explain why this change benefits reads more than writes, > > and > > 2) work-stealing is hard to get right, and I can't find any examples in the > > kernel. > > > > Can anybody offer tips or code for implementing work stealing? Or any > > other suggestions about why my write performance is suffering? I would > > like to get this change committed, but not without resolving that issue. > > > > I can't comment on revamping the design, but: > > void > vmem_free(vmem_t *vm, vmem_addr_t addr, vmem_size_t size) > { > qcache_t *qc; > MPASS(size > 0); > > if (size <= vm->vm_qcache_max && > __predict_true(addr >= VMEM_ADDR_QCACHE_MIN)) { > qc = &vm->vm_qcache[(size - 1) >> vm->vm_quantum_shift]; > uma_zfree(qc->qc_cache, (void *)addr); > } else > vmem_xfree(vm, addr, size); > } > > What sizes are being passed here? Or more to the point, is it feasible > to bump qcache to stick to uma in this call? If lock contention is > indeed coming from vmem_xfree this change would get rid of the problem > without having to rework anything. We would have to enable the quantum cache in the transient KVA arena. This itself should not have many downsides on platforms with plenty of KVA, but it only solves the immediate problem: before freeing the KVA biodone() has to perform a global TLB shootdown, and the quantum cache doesn't help at all with that. kib's suggestion of using sf_buf(9) to transiently map crypto(9) payloads in software crypto drivers that require a mapping, and using unmapped cryptop requests for hardware drivers that do not, sounds like the right solution. cryptop structures can already handle multiple data container types, like uios and mbufs, so it should be possible to also support vm_page arrays in OCF like we do for unmapped BIOs, and let crypto(9) drivers create transient mappings when necessary. > For read performance, while it is nice there is a win, it may still be > less than it should. I think it is prudent to get a flamegraph from > both cases. > > -- > Mateusz Guzik > _______________________________________________ > 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" From owner-freebsd-hackers@freebsd.org Fri Jul 10 19:39:44 2020 Return-Path: Delivered-To: freebsd-hackers@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B5129371B1E for ; Fri, 10 Jul 2020 19:39:44 +0000 (UTC) (envelope-from se@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4B3NfS47vzz3YMJ; Fri, 10 Jul 2020 19:39:44 +0000 (UTC) (envelope-from se@freebsd.org) Received: from Stefans-MBP-WLAN.fritz.box (p200300cd5f0bb900bc86521febb2afc9.dip0.t-ipconnect.de [IPv6:2003:cd:5f0b:b900:bc86:521f:ebb2:afc9]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: se/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id E9FAB1060A; Fri, 10 Jul 2020 19:39:43 +0000 (UTC) (envelope-from se@freebsd.org) Subject: Re: Huge mergeinfo list after merge from vendor branch To: "Rodney W. Grimes" References: <202007101640.06AGeloK096110@gndrsh.dnsmgr.net> From: =?UTF-8?Q?Stefan_E=c3=9fer?= Autocrypt: addr=se@freebsd.org; keydata= mQENBFVxiRIBCADOLNOZBsqlplHUQ3tG782FNtVT33rQli9EjNt2fhFERHIo4NxHlWBpHLnU b0s4L/eItx7au0i7Gegv01A9LUMwOnAc9EFAm4EW3Wmoa6MYrcP7xDClohg/Y69f7SNpEs3x YATBy+L6NzWZbJjZXD4vqPgZSDuMcLU7BEdJf0f+6h1BJPnGuwHpsSdnnMrZeIM8xQ8PPUVQ L0GZkVojHgNUngJH6e21qDrud0BkdiBcij0M3TCP4GQrJ/YMdurfc8mhueLpwGR2U1W8TYB7 4UY+NLw0McThOCLCxXflIeF/Y7jSB0zxzvb/H3LWkodUTkV57yX9IbUAGA5RKRg9zsUtABEB AAG0J1N0ZWZhbiBFw59lciAoRnJlZUJTRCkgPHNlQGZyZWVic2Qub3JnPokBVAQTAQoAPgIb AwULCQgHAwUVCgkICwUWAwIBAAIeAQIXgBYhBKNx6mWcC+zIK3FTE0frte9a/fVEBQJa8u+q BQkLJQETAAoJEEfrte9a/fVEOeMH/icmdK1eZQvB3U8quJo9VMaZsaTuCMbUE4NThyfsIvIm MCd+rb/yULmMYwqNfjyKB1x4ikR4x+94l+yJoz7K0Usks+eNKDmMGJM6pWWssTigaJubFdVd hVVC+C1QJi7JshYSib08uONoPmO4lv5Az0TDYGtsMzsES2sIlc62c9go5WPGYhQFRbX3Lk6y V6m8OHh+G9XGSj3oPO4UteRwu+SzTdOLunZBWG1wu34+IeZm663D+2gOppQLWpLa2qaTerqw THu377ayZ2B2LPJ5JkvkZeHYPkwDQ+b5PGn0UhfkxPnDVYki5F7qKxvQ5uq1/q9YaCX7mmOl H2yO7tgVsrW5AQ0EVXGJEgEIALEj9qCXMZVucjpcd3QxM/TlUr98m5viEd1z4tCnPUyRWcIC EVtj2h5xMH+2iB0q1+KWhq+NsWtvScmEmfHnsr7dJ1K677OdpDhKVaJk61eeRulFY1R4yb6C 1MMxK+WgYB+vvpG0UeyR0M4uBewcPvRsq4yGUHFQKtLAbMdoPTSryJA+ElnmK1vdY+rPcHgi OIMBZM7ahsPXC0C9K4e5SP9clGyIoMpbfHXdx9q+Rp3zVtlbhyk3BS/xccu/+9pk9ICXL6GR js2sNnJ0wxdU1DsAlC59a5MnSruwiZFwRnkQhr3x6wk97Lg7sLS9jjTnCN7LGlVmSmpOEMy6 uq1AWfUAEQEAAYkBPAQYAQoAJgIbDBYhBKNx6mWcC+zIK3FTE0frte9a/fVEBQJa8u+rBQkL JQEZAAoJEEfrte9a/fVEuesH/2DNxGWnHvWwMyiyhlQtafvDKwEn/wAgR8gHJFodB7emf8rA TnukH7MVttCoHtjN5lvv9RSBHjNTZls5wR/ANlwdRuPQHd8ZGxLe3S6IuUB3zDSwFltLGurO N2kOMhs5mTGyypSa+uw3rtQbUAVYf1oPbiR4FLtiM8FLyEvE95hX5fPq9Qvx9FmN79kmCIEw jDKPqDaUf/OR2fEF0LSIbXHEk4tNqCEwx5DIJ0fp5/z5UzICUAmwxyRs5O/Hre1jzPsMVyud Ml9t7UTOJGKVWwRory1PMnOFxN+iz5/d4FhYSKXF7kfMiFgol4LuWaxJRwbBrr71VGBrRy2a L1nw6Bc= Cc: FreeBSD Hackers Message-ID: <09e7f77b-7d7d-f5ee-5432-c63f4932e979@freebsd.org> Date: Fri, 10 Jul 2020 21:39:42 +0200 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <202007101640.06AGeloK096110@gndrsh.dnsmgr.net> Content-Type: text/plain; charset=windows-1252 Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Jul 2020 19:39:44 -0000 Am 10.07.20 um 18:40 schrieb Rodney W. Grimes: >> We have gathered lots of mergeinfo junk in the source tree over the >> decades, but I did not know it was so bad ... >> >> >> I had not performed any merges for a long time and now that I have >> to merge from the vendor branch to contrib in -CURRENT, I'm surprised >> by the long mergeinfo list I got: >> >> $ svn propget svn:mergeinfo -R /usr/src/contrib/bc >> . - /projects/bectl/contrib/bc:336666-337662 >> /projects/bsd_rdma_4_9/contrib/bc:319973-326168 >> /projects/bsnmp-improved-ipv6-support/contrib/bc:301868 >> /projects/building-blocks/contrib/bc:275142-275143,275198,275297,275306-275307,275309,275311,275556,275558,275600,277445,277670,277673 >> /projects/clang-sparc64/contrib/bc:262258-262612 >> /projects/clang-trunk/contrib/bc:283596-287505 >> [...] >> /vendor/bc/dist:362987-363077 >> /vendor/device-tree/dist/contrib/bc:303380 >> /vendor/resolver/dist/contrib/bc:1540-186085 >> >> A total of 56 lines, which are not relevant to this software, except for >> the 3rd last line: >> >> /vendor/bc/dist:362987-363077 >> >> Before causing a mess in the repo by committing the merged sources, >> I'd like to know whether this is "normal" behavior, or whether I need >> to clean up the mergeinfo before the commit. >> >> Thanks in advance, STefan >> >> PS: The committers handbook has quite some information regarding this >> kind of merge, but it makes me think that only the relevant mergeinfo >> line should have been registered ... Hi Rodney, thank you for responding. I'm holding back a bug-fix commit due to this situation, and I'd like to get the commit done ... > Was a merge done from the wrong working directory? I do not think that this was the case. BTW: Chapter 5.3 of the Developers Handbook gives this advice: % cd head/contrib/foo % svn update % svn merge --accept=postpone ^/vendor/foo/dist I have reverted the merge in my check-out, verified that the mergeinfo was gone and then performed the MFV again with the following command, just to be sure: % cd /usr/svn/base/head % svn merge --accept=postpone ^/vendor/bc/dist contrib/bc The result is exactly the state of before the revert and reapplied MFV, with 56 lines of mergeinfo (pre-dating the vendor import, and applying to other contrib/bc paths, e.g.: /projects/pf/head/contrib/bc:263908. > Merges need to be done while cwd is the top level of the src tree. Yes, I know, and I did it that way (despite the differing advice given in the Developers Handbook). > If done in a subdirectory a massive pile of unwanted mergeinfo is created. And I have repeated the same merge command from within /usr/svn/base (i.e. one level below the head directory), again with identical results. > You can step back through the merge commits and see when this happened. The contents of contrib/bc has been created via "svn copy" from the vendor area, this is the first attempted MFV that updates the contrib directory beyond the initial import. The mergeinfo is for prior revisions of files in **/contrib/bc, e.g. in project or user directories in our SVN repository, which are in no way related to the commit I'm about to do. If I do not receive any direct advice how to resolve this situation, I'll do the commit, anyway. I could force a correct mergeinfo with propset svn:mergeinfo, I assume, but I'm afarid this could lead to breakage or consistency problems later-on. Best regards, STefan From owner-freebsd-hackers@freebsd.org Fri Jul 10 20:15:58 2020 Return-Path: Delivered-To: freebsd-hackers@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CB7A437260A for ; Fri, 10 Jul 2020 20:15:58 +0000 (UTC) (envelope-from leres@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4B3PSG4ssnz3bZ3; Fri, 10 Jul 2020 20:15:58 +0000 (UTC) (envelope-from leres@freebsd.org) Received: from ice.alameda.xse.com (unknown [IPv6:2600:1700:a570:11f0:f2ad:4eff:fe0b:a065]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: leres) by smtp.freebsd.org (Postfix) with ESMTPSA id 405B810BD8; Fri, 10 Jul 2020 20:15:58 +0000 (UTC) (envelope-from leres@freebsd.org) Subject: Re: FreeBSD Security Advisory FreeBSD-SA-20:19.unbound From: Craig Leres To: Gordon Tetlow References: <20200708210700.280D517D45@freefall.freebsd.org> Cc: "freebsd-hackers@freebsd.org" Message-ID: <5582c7d5-aca8-e6f2-571f-0fb384eb4e2f@freebsd.org> Date: Fri, 10 Jul 2020 13:15:56 -0700 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Jul 2020 20:15:58 -0000 On 2020-07-09 13:55, Craig Leres wrote: > Can I fix this by changing my Components line. Maybe this? > >     Components src/src world/base To wrap up this change solved my issue. Craig From owner-freebsd-hackers@freebsd.org Fri Jul 10 20:39:55 2020 Return-Path: Delivered-To: freebsd-hackers@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 48E9F3731A5 for ; Fri, 10 Jul 2020 20:39:55 +0000 (UTC) (envelope-from sjg@juniper.net) Received: from mx0b-00273201.pphosted.com (mx0b-00273201.pphosted.com [67.231.152.164]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.pphosted.com", Issuer "Thawte RSA CA 2018" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4B3Pzt0bZMz3ds3; Fri, 10 Jul 2020 20:39:53 +0000 (UTC) (envelope-from sjg@juniper.net) Received: from pps.filterd (m0108163.ppops.net [127.0.0.1]) by mx0b-00273201.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 06AJCiTB028183; Fri, 10 Jul 2020 12:22:09 -0700 Received: from nam11-bn8-obe.outbound.protection.outlook.com (mail-bn8nam11lp2174.outbound.protection.outlook.com [104.47.58.174]) by mx0b-00273201.pphosted.com with ESMTP id 325k32vb19-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 10 Jul 2020 12:22:09 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=li0g4+LgmWwK8oxu2AW6U7ODi1ItAM/9uflb+/WjQLky180WdQOeZ8mgdxVUDQOPsH9zNUrcSxQ+OzcqzFNLG51V0JRcwZMQSDPxnUGcqb2GmNhzjt72HFuUmfHmIAJVU9uMBS+uaXIBBVxtpYdDZ4V6PsIz3G8fWXjpY3ZMOnruouCsLv9WMntsycI+VhbdDAlXwedemt7OX71ILbZ7UbHiCY20Ejn1xtSUxQPJ6INNlygdBsVGJonOdopwDJCO6d1Txkwe9544N49fT52yxVyE4pxxCyz9xFivXQwyD7Vsqc7aBXciI1Bv7aNq4fZI1jhYmBkPJyz/oxeopeepEA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=6K2SbsqL8u2swCSXuAjfHFcy+Yu1EuDf7T3x4zrAsng=; b=aR0viDUvsm+X0fXtFgmNMM4m512cKeMJonoT084PPay/XL+VS4gH59PcruU1rxf9amuFTkWjGwrsiaZJcjzEjArT4ow4qsVju71b/xSzH/eXA46HlVehMxjD7T/xTvkztSu21FyvW7kpLqgo2oU992S04R1JIsVQPhRVqUE2OG6zg1Z/ulR5DvRjl83yTivI3O0Ix3FXCppP2/0HeMilIT8h1MmVRNtd1vXXYePSq9yvZ9T4JOuwmhZ/PnT7mG2R0EThCx55Fomc8JF2fFdrfN9ZyAf1NYs3PkJrqJOEYb1i3H2tAkBe3YnILoUdqr9hAQuqbifO+a5bKt8Bc11V8g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=softfail (sender ip is 66.129.239.13) smtp.rcpttodomain=freebsd.org smtp.mailfrom=juniper.net; dmarc=fail (p=reject sp=reject pct=100) action=oreject header.from=juniper.net; dkim=none (message not signed); arc=none Received: from DM5PR19CA0001.namprd19.prod.outlook.com (2603:10b6:3:151::11) by SN6PR05MB3949.namprd05.prod.outlook.com (2603:10b6:805:24::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3195.9; Fri, 10 Jul 2020 19:22:08 +0000 Received: from DM3NAM05FT020.eop-nam05.prod.protection.outlook.com (2603:10b6:3:151:cafe::1) by DM5PR19CA0001.outlook.office365.com (2603:10b6:3:151::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3174.21 via Frontend Transport; Fri, 10 Jul 2020 19:22:08 +0000 X-MS-Exchange-Authentication-Results: spf=softfail (sender IP is 66.129.239.13) smtp.mailfrom=juniper.net; freebsd.org; dkim=none (message not signed) header.d=none;freebsd.org; dmarc=fail action=oreject header.from=juniper.net; Received-SPF: SoftFail (protection.outlook.com: domain of transitioning juniper.net discourages use of 66.129.239.13 as permitted sender) Received: from P-EXFEND-EQX-02.jnpr.net (66.129.239.13) by DM3NAM05FT020.mail.protection.outlook.com (10.152.98.129) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.3195.9 via Frontend Transport; Fri, 10 Jul 2020 19:22:07 +0000 Received: from P-EXBEND-EQX-01.jnpr.net (10.104.8.52) by P-EXFEND-EQX-02.jnpr.net (10.104.8.55) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Fri, 10 Jul 2020 12:21:20 -0700 Received: from p-mailhub01.juniper.net (10.104.20.6) by P-EXBEND-EQX-01.jnpr.net (10.104.8.52) with Microsoft SMTP Server (TLS) id 15.0.1497.2 via Frontend Transport; Fri, 10 Jul 2020 12:21:20 -0700 Received: from kaos.jnpr.net (kaos.jnpr.net [172.23.255.254]) by p-mailhub01.juniper.net (8.14.4/8.11.3) with ESMTP id 06AJLJ9t016458; Fri, 10 Jul 2020 12:21:19 -0700 (envelope-from sjg@juniper.net) Received: by kaos.jnpr.net (Postfix, from userid 1377) id 6EA966F7BF; Fri, 10 Jul 2020 12:21:19 -0700 (PDT) Received: from kaos.jnpr.net (localhost [127.0.0.1]) by kaos.jnpr.net (Postfix) with ESMTP id 6E30D6F7BE; Fri, 10 Jul 2020 12:21:19 -0700 (PDT) To: "Rodney W. Grimes" CC: =?UTF-8?Q?Stefan_E=C3=9Fer?= , FreeBSD Hackers , Subject: Re: Huge mergeinfo list after merge from vendor branch In-Reply-To: <202007101640.06AGeloK096110@gndrsh.dnsmgr.net> References: <202007101640.06AGeloK096110@gndrsh.dnsmgr.net> Comments: In-reply-to: "Rodney W. Grimes" message dated "Fri, 10 Jul 2020 09:40:47 -0700." From: "Simon J. Gerraty" X-Mailer: MH-E 8.6+git; nmh 1.7.1; GNU Emacs 26.3 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <62460.1594408879.1@kaos.jnpr.net> Date: Fri, 10 Jul 2020 12:21:19 -0700 Message-ID: <64190.1594408879@kaos.jnpr.net> X-EXCLAIMER-MD-CONFIG: e3cb0ff2-54e7-4646-8a04-0dae4ac7b136 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:66.129.239.13; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:P-EXFEND-EQX-02.jnpr.net; PTR:InfoDomainNonexistent; CAT:NONE; SFTY:; SFS:(4636009)(376002)(39860400002)(346002)(396003)(136003)(46966005)(316002)(70206006)(54906003)(6266002)(107886003)(82310400002)(70586007)(356005)(83380400001)(2906002)(7696005)(47076004)(9686003)(86362001)(81166007)(478600001)(82740400003)(336012)(26005)(4326008)(55016002)(7126003)(5660300002)(6916009)(8936002)(186003)(4744005)(8676002)(14583001); DIR:OUT; SFP:1102; X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: cef07a17-204c-4070-11dc-08d82506897b X-MS-TrafficTypeDiagnostic: SN6PR05MB3949: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:7691; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 6BTmFt/k9f+l5F6rKHD4cf00Rwn0o5EGhDD3EbfOiXU3kQKwDtC8499RDOZ2QsMwSfzKTfN/hCd4mWAyG0//BxLH+ef3v1jqdH8GbIZKO/juE78Hcb7C8kh1j3HSdyf6BWJH3C8U/EsDPvZbiAAi7jswXbgQDNCOv6H7T+B7wFTa+YXXk/XmfHh0lVliXQpAZMZm87IPEWUBbaAPsQfNMQxgK+gALyzLJqp9Zv4K8hifMONEVLiasr42v18vN2NGebW+eMYmTLivD+Df81+uXlDJzO3W+sQuJBFm9Vm6iTagLhr5ghGOdGLQwXWBvraD2i1NNzijoudAq+1jkF6ccmrSciKvyqMATFu4uyPRwJaQoHJcpJ4ckMCoROapePEFPEXHiBEzZ5A/VVMxHnN76JZ5NpBrmuG2P/xe0vjLke4= X-OriginatorOrg: juniper.net X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Jul 2020 19:22:07.8421 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: cef07a17-204c-4070-11dc-08d82506897b X-MS-Exchange-CrossTenant-Id: bea78b3c-4cdb-4130-854a-1d193232e5f4 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=bea78b3c-4cdb-4130-854a-1d193232e5f4; Ip=[66.129.239.13]; Helo=[P-EXFEND-EQX-02.jnpr.net] X-MS-Exchange-CrossTenant-AuthSource: DM3NAM05FT020.eop-nam05.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN6PR05MB3949 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.235, 18.0.687 definitions=2020-07-10_14:2020-07-10, 2020-07-10 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_spam_notspam policy=outbound_spam score=0 lowpriorityscore=0 mlxlogscore=524 impostorscore=0 bulkscore=0 adultscore=0 priorityscore=1501 phishscore=0 suspectscore=0 malwarescore=0 spamscore=0 mlxscore=0 clxscore=1011 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2006250000 definitions=main-2007100126 X-Rspamd-Queue-Id: 4B3Pzt0bZMz3ds3 X-Spamd-Bar: +++ X-Spamd-Result: default: False [3.58 / 15.00]; GREYLIST(0.00)[pass,body]; RECEIVED_SPAMHAUS_XBL(5.00)[66.129.239.13:received]; R_DKIM_ALLOW(0.00)[juniper.net:s=PPS1017,juniper.net:s=selector1]; NEURAL_HAM_MEDIUM(-0.59)[-0.590]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(0.00)[+ip4:67.231.152.164]; MIME_GOOD(-0.10)[text/plain]; NEURAL_HAM_LONG(-0.31)[-0.311]; BAD_REP_POLICIES(0.10)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[juniper.net:+]; DMARC_POLICY_ALLOW(0.00)[juniper.net,reject]; NEURAL_HAM_SHORT(-0.42)[-0.416]; RCVD_IN_DNSWL_LOW(-0.10)[67.231.152.164:from]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:22843, ipnet:67.231.152.0/24, country:US]; RCVD_TLS_LAST(0.00)[]; RCVD_COUNT_SEVEN(0.00)[10]; ARC_ALLOW(0.00)[microsoft.com:s=arcselector9901:i=1] X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Jul 2020 20:39:55 -0000 Rodney W. Grimes wrote: > Was a merge done from the wrong working directory? > Merges need to be done while cwd is the top level of the src tree. Pretty sure the examples in the svn primer show cd contrib/foo svn merge ^/vendor/FOO/foo/dist . if that's not correct, and update would be useful. From owner-freebsd-hackers@freebsd.org Fri Jul 10 23:14:08 2020 Return-Path: Delivered-To: freebsd-hackers@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CFBD03762FA for ; Fri, 10 Jul 2020 23:14:08 +0000 (UTC) (envelope-from asomers@gmail.com) Received: from mail-ot1-f48.google.com (mail-ot1-f48.google.com [209.85.210.48]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4B3TPr05blz44qc; Fri, 10 Jul 2020 23:14:07 +0000 (UTC) (envelope-from asomers@gmail.com) Received: by mail-ot1-f48.google.com with SMTP id e90so5392129ote.1; Fri, 10 Jul 2020 16:14:07 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=kd/FsIBSEQuSvY7b06rMDMmdLbSt0aTBoOYLeWeYdbM=; b=iOnpTZBVp3sNnn1cK6c0hWK951SuNxilFcH1NVnC7HYy6AHElbTlBSZqYq/PT4Y3G2 V3B3RjfzZb/gybuNeyNsH9wDHNrNP+jR8Wqo59sD2KAkVSVtwCqHpAZ13OHPx9pmPtX1 WBx44KzflptL6bPbrEpq+ftIJWFcrwIUKsmumsQ4egwRni1/LrhXtZ+G9T0lZtLEJvms pKkshhyqbFgGW/3yf5cG/+HxJRLmGmQESlsPvdPR1kMeG0O+rdxMmwNGcBkptEMGs0Ad 4rbwLvE4Sk2LBu8esTUSIq1U3YRcXZKN7uA+Xhp4KUm6H7RL6GqW8pgJSXO6wW2lhR92 By0w== X-Gm-Message-State: AOAM530kP7wGLPZtJ4znQgRYVjKKVeJunRqLYcEftiDmqQjER+CJZuPE LbpoqYI0pPP3ojR/TZDg2EoFoZhskCvlBU7asAuoqge229M= X-Google-Smtp-Source: ABdhPJziicOyo3te8uuMcLkjie8+fJZ38n6/LvYrmbNzmO+pIzjQMko13ZrC7OhpxaEZjMjJD06SClwzJTdhvrALMB8= X-Received: by 2002:a9d:2788:: with SMTP id c8mr43078384otb.251.1594422845600; Fri, 10 Jul 2020 16:14:05 -0700 (PDT) MIME-Version: 1.0 References: <20200710175452.GA9380@raichu> In-Reply-To: <20200710175452.GA9380@raichu> From: Alan Somers Date: Fri, 10 Jul 2020 17:13:52 -0600 Message-ID: Subject: Re: Right-sizing the geli thread pool To: Mark Johnston Cc: Mateusz Guzik , FreeBSD Hackers X-Rspamd-Queue-Id: 4B3TPr05blz44qc X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.33 X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Jul 2020 23:14:08 -0000 On Fri, Jul 10, 2020 at 11:55 AM Mark Johnston wrote: > On Fri, Jul 10, 2020 at 05:55:50AM +0200, Mateusz Guzik wrote: > > On 7/9/20, Alan Somers wrote: > > > Currently, geli creates a separate thread pool for each provider, and > by > > > default each thread pool contains one thread per cpu. On a large > server > > > with many encrypted disks, that can balloon into a very large number of > > > threads! I have a patch in progress that switches from per-provider > thread > > > pools to a single thread pool for the entire module. Happily, I see > read > > > IOPs increase by up to 60%. But to my surprise, write IOPs > _decreases_ by > > > up to 25%. dtrace suggests that the CPU usage is dominated by the > > > vmem_free call in biodone, as in the below stack. > > > > > > kernel`lock_delay+0x32 > > > kernel`biodone+0x88 > > > kernel`g_io_deliver+0x214 > > > geom_eli.ko`g_eli_write_done+0xf6 > > > kernel`g_io_deliver+0x214 > > > kernel`md_kthread+0x275 > > > kernel`fork_exit+0x7e > > > kernel`0xffffffff8104784e > > > > > > I only have one idea for how to improve things from here. The geli > thread > > > pool is still fed by a single global bio queue. That could cause cache > > > thrashing, if bios get moved between cores too often. I think a > superior > > > design would be to use a separate bio queue for each geli thread, and > use > > > work-stealing to balance them. However, > > > > > > 1) That doesn't explain why this change benefits reads more than > writes, > > > and > > > 2) work-stealing is hard to get right, and I can't find any examples > in the > > > kernel. > > > > > > Can anybody offer tips or code for implementing work stealing? Or any > > > other suggestions about why my write performance is suffering? I would > > > like to get this change committed, but not without resolving that > issue. > > > > > > > I can't comment on revamping the design, but: > > > > void > > vmem_free(vmem_t *vm, vmem_addr_t addr, vmem_size_t size) > > { > > qcache_t *qc; > > MPASS(size > 0); > > > > if (size <= vm->vm_qcache_max && > > __predict_true(addr >= VMEM_ADDR_QCACHE_MIN)) { > > qc = &vm->vm_qcache[(size - 1) >> vm->vm_quantum_shift]; > > uma_zfree(qc->qc_cache, (void *)addr); > > } else > > vmem_xfree(vm, addr, size); > > } > > > > What sizes are being passed here? Or more to the point, is it feasible > > to bump qcache to stick to uma in this call? If lock contention is > > indeed coming from vmem_xfree this change would get rid of the problem > > without having to rework anything. > > We would have to enable the quantum cache in the transient KVA arena. > This itself should not have many downsides on platforms with plenty of > KVA, but it only solves the immediate problem: before freeing the KVA > biodone() has to perform a global TLB shootdown, and the quantum cache > doesn't help at all with that. > > kib's suggestion of using sf_buf(9) to transiently map crypto(9) > payloads in software crypto drivers that require a mapping, and using > unmapped cryptop requests for hardware drivers that do not, sounds like > the right solution. cryptop structures can already handle multiple data > container types, like uios and mbufs, so it should be possible to also > support vm_page arrays in OCF like we do for unmapped BIOs, and let > crypto(9) drivers create transient mappings when necessary. > > > For read performance, while it is nice there is a win, it may still be > > less than it should. I think it is prudent to get a flamegraph from > > both cases. > And, it works! Using sf_buf was a good suggestion, because the write path only needs to access the user data for a short amount of time, in a CPU-pinned thread. So I can create my sf_buf and immediately free it. I didn't even need to change crypto(9). Writes are much faster now. I haven't incorporated sf_buf into the read path yet, though. Preliminary benchmarks: Write IOPs READ IOPs baseline 66908 60351 kern.geom.eli.threads=1 156719 144117 kern.geom.eli.threads=1, direct dispatch 205326 201867 direct dispatch, shared thread pool 156631 226874 direct dispatch, shared thread pool, sf_buf 432573 247275 -Alan From owner-freebsd-hackers@freebsd.org Fri Jul 10 23:45:57 2020 Return-Path: Delivered-To: freebsd-hackers@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E256F3769E8 for ; Fri, 10 Jul 2020 23:45:57 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pl1-x62d.google.com (mail-pl1-x62d.google.com [IPv6:2607:f8b0:4864:20::62d]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4B3V6X6FGpz46Qy for ; Fri, 10 Jul 2020 23:45:56 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pl1-x62d.google.com with SMTP id x11so2876619plo.7 for ; Fri, 10 Jul 2020 16:45:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=uF4yIm7szxRyvbAhUCtVerY1XOA7s8pLJHMLcbmN6RI=; b=cbI6FueGNsNVERspGw1Hyoe8FdoOe6syIw+D8BaUoxrA6JLIAzC0TCWJ7pPVPjlkNh hWm5VuxcUIB5RHv+xZYLST3TGE+iMmINLLWo2rXWbsMOfRzf+wp+4xHXWcO7xcydEMKP NTXiBGEyuSnzUjntcqrNb1I1i2U3pMKQ/hURmYgEHgwV8C1uQcgyiEoD+uwtlV7h165I A2/lhFjm2TR5dZgb4Cc2DXZxuOgFNp0iSl/ijDsTQZo7uUOV1yVQU07L/7UXHB+3Urn0 1pkH+/Bp+H/g1LAM4hr2tVsrzJNlMoztMqxJ6PE3kuOVLuubJX+h3zuKrQ2XnzVV6GU8 HN5w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=uF4yIm7szxRyvbAhUCtVerY1XOA7s8pLJHMLcbmN6RI=; b=J54jJ1x7RD02rTPB023xCAqu3aTkKbhFIYLta+ioSpkw3uNKp67FKkICUyUIRNGuoo nx4pUqXObdGdJpHt7azFGrHpKwdZrPtFNF/0xR2FYmj5lzuP8eu7/pVulQk2rqf18FdM PoQD/uirgs11nnQ4rtm6HNjXuPzsjnmzKXz3D5OOcvCT7e/wj8tM7AQc5/qRX5jE1cjg ihe7fFrR1ewiJsVomnN+8vq87Ts2x0NhBf1oqF7b9/6RlB9p04RHd/H30jWmZZHxhqpH V25gmOWy+dzJ1m3FRrtom3NwmirZ29fwLe/vS+Psjp+BVq/6X934nVCXosolDdVhpRy2 031g== X-Gm-Message-State: AOAM531S3RY/wJjTXBo4TZRLSKpzJ+m/Lxh2dQtzOrR4pvQKC4kgb29k BDY/WPK931Pbw/kiCBKv+NdngUhcRmI= X-Google-Smtp-Source: ABdhPJybvKHUn2ryRVh7STSKig0si5O6x3k+nFTfmdtqB0JpaO2yxeMak/b5knD1sZNspeKdf/NHBw== X-Received: by 2002:a17:90a:324c:: with SMTP id k70mr8645469pjb.18.1594424755234; Fri, 10 Jul 2020 16:45:55 -0700 (PDT) Received: from [192.168.20.26] (c-73-19-52-228.hsd1.wa.comcast.net. [73.19.52.228]) by smtp.gmail.com with ESMTPSA id f18sm6466792pgv.84.2020.07.10.16.45.54 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 10 Jul 2020 16:45:54 -0700 (PDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.80.23.2.2\)) Subject: Re: Huge mergeinfo list after merge from vendor branch From: Enji Cooper In-Reply-To: <64190.1594408879@kaos.jnpr.net> Date: Fri, 10 Jul 2020 16:45:54 -0700 Cc: "Rodney W. Grimes" , FreeBSD Hackers Content-Transfer-Encoding: quoted-printable Message-Id: <92E891A1-0F43-458D-9B73-1011C81AFCBE@gmail.com> References: <202007101640.06AGeloK096110@gndrsh.dnsmgr.net> <64190.1594408879@kaos.jnpr.net> To: "Simon J. Gerraty" X-Mailer: Apple Mail (2.3608.80.23.2.2) X-Rspamd-Queue-Id: 4B3V6X6FGpz46Qy X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=cbI6FueG; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of yaneurabeya@gmail.com designates 2607:f8b0:4864:20::62d as permitted sender) smtp.mailfrom=yaneurabeya@gmail.com X-Spamd-Result: default: False [-3.25 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; FREEMAIL_FROM(0.00)[gmail.com]; MV_CASE(0.50)[]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36]; RCVD_COUNT_THREE(0.00)[3]; TO_DN_ALL(0.00)[]; DKIM_TRACE(0.00)[gmail.com:+]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; NEURAL_HAM_SHORT(-0.78)[-0.779]; RECEIVED_SPAMHAUS_PBL(0.00)[73.19.52.228:received]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; MID_RHS_MATCH_FROM(0.00)[]; DWL_DNSWL_NONE(0.00)[gmail.com:dkim]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-0.97)[-0.966]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; NEURAL_HAM_LONG(-1.01)[-1.009]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-hackers@freebsd.org]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::62d:from]; RCVD_TLS_ALL(0.00)[] X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Jul 2020 23:45:57 -0000 > On Jul 10, 2020, at 12:21 PM, Simon J. Gerraty via freebsd-hackers = wrote: >=20 > Rodney W. Grimes wrote: >> Was a merge done from the wrong working directory? >> Merges need to be done while cwd is the top level of the src tree. >=20 > Pretty sure the examples in the svn primer show >=20 > cd contrib/foo > svn merge ^/vendor/FOO/foo/dist . >=20 > if that's not correct, and update would be useful. Hi, What sjg@ pointed out is the proper way to handle vendor = updates/imports. Thanks so much! -Enji= From owner-freebsd-hackers@freebsd.org Fri Jul 10 23:50:37 2020 Return-Path: Delivered-To: freebsd-hackers@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 441CA37712B for ; Fri, 10 Jul 2020 23:50:37 +0000 (UTC) (envelope-from freebsd-rwg@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4B3VCv5l4rz46f0 for ; Fri, 10 Jul 2020 23:50:35 +0000 (UTC) (envelope-from freebsd-rwg@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (localhost [127.0.0.1]) by gndrsh.dnsmgr.net (8.13.3/8.13.3) with ESMTP id 06ANoWxH097420; Fri, 10 Jul 2020 16:50:32 -0700 (PDT) (envelope-from freebsd-rwg@gndrsh.dnsmgr.net) Received: (from freebsd-rwg@localhost) by gndrsh.dnsmgr.net (8.13.3/8.13.3/Submit) id 06ANoWK5097419; Fri, 10 Jul 2020 16:50:32 -0700 (PDT) (envelope-from freebsd-rwg) From: "Rodney W. Grimes" Message-Id: <202007102350.06ANoWK5097419@gndrsh.dnsmgr.net> Subject: Re: Huge mergeinfo list after merge from vendor branch In-Reply-To: <92E891A1-0F43-458D-9B73-1011C81AFCBE@gmail.com> To: Enji Cooper Date: Fri, 10 Jul 2020 16:50:32 -0700 (PDT) CC: "Simon J. Gerraty" , "Rodney W. Grimes" , FreeBSD Hackers X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Rspamd-Queue-Id: 4B3VCv5l4rz46f0 X-Spamd-Bar: ++ Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=none (mx1.freebsd.org: domain of freebsd-rwg@gndrsh.dnsmgr.net has no SPF policy when checking 69.59.192.140) smtp.mailfrom=freebsd-rwg@gndrsh.dnsmgr.net X-Spamd-Result: default: False [2.15 / 15.00]; ARC_NA(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; NEURAL_SPAM_SHORT(0.08)[0.079]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[dnsmgr.net]; AUTH_NA(1.00)[]; NEURAL_SPAM_MEDIUM(0.81)[0.812]; TO_MATCH_ENVRCPT_SOME(0.00)[]; TO_DN_ALL(0.00)[]; NEURAL_SPAM_LONG(0.36)[0.360]; R_SPF_NA(0.00)[no SPF record]; FREEMAIL_TO(0.00)[gmail.com]; FROM_EQ_ENVFROM(0.00)[]; RCVD_TLS_LAST(0.00)[]; R_DKIM_NA(0.00)[]; ASN(0.00)[asn:13868, ipnet:69.59.192.0/19, country:US]; MIME_TRACE(0.00)[0:+]; MID_RHS_MATCH_FROM(0.00)[]; RCVD_COUNT_TWO(0.00)[2] X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Jul 2020 23:50:37 -0000 > > > On Jul 10, 2020, at 12:21 PM, Simon J. Gerraty via freebsd-hackers wrote: > > > > Rodney W. Grimes wrote: > >> Was a merge done from the wrong working directory? > >> Merges need to be done while cwd is the top level of the src tree. > > > > Pretty sure the examples in the svn primer show > > > > cd contrib/foo > > svn merge ^/vendor/FOO/foo/dist . > > > > if that's not correct, and update would be useful. > > Hi, > What sjg@ pointed out is the proper way to handle vendor updates/imports. > Thanks so much! I wonder if it is because of a svn copy that was done to originally create contrib/foo rather than an svn merge? -- Rod Grimes rgrimes@freebsd.org From owner-freebsd-hackers@freebsd.org Sat Jul 11 07:49:22 2020 Return-Path: Delivered-To: freebsd-hackers@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 882A935A277 for ; Sat, 11 Jul 2020 07:49:22 +0000 (UTC) (envelope-from se@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4B3hrK35vPz4ZLR; Sat, 11 Jul 2020 07:49:19 +0000 (UTC) (envelope-from se@freebsd.org) Received: from Stefans-MBP-WLAN.fritz.box (p200300cd5f0bb900bc86521febb2afc9.dip0.t-ipconnect.de [IPv6:2003:cd:5f0b:b900:bc86:521f:ebb2:afc9]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: se/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id F251515C12; Sat, 11 Jul 2020 07:49:17 +0000 (UTC) (envelope-from se@freebsd.org) Subject: (solved) Re: Huge mergeinfo list after merge from vendor branch To: "Rodney W. Grimes" , Enji Cooper , "Simon J. Gerraty" Cc: FreeBSD Hackers References: <202007102350.06ANoWK5097419@gndrsh.dnsmgr.net> From: =?UTF-8?Q?Stefan_E=c3=9fer?= Autocrypt: addr=se@freebsd.org; keydata= mQENBFVxiRIBCADOLNOZBsqlplHUQ3tG782FNtVT33rQli9EjNt2fhFERHIo4NxHlWBpHLnU b0s4L/eItx7au0i7Gegv01A9LUMwOnAc9EFAm4EW3Wmoa6MYrcP7xDClohg/Y69f7SNpEs3x YATBy+L6NzWZbJjZXD4vqPgZSDuMcLU7BEdJf0f+6h1BJPnGuwHpsSdnnMrZeIM8xQ8PPUVQ L0GZkVojHgNUngJH6e21qDrud0BkdiBcij0M3TCP4GQrJ/YMdurfc8mhueLpwGR2U1W8TYB7 4UY+NLw0McThOCLCxXflIeF/Y7jSB0zxzvb/H3LWkodUTkV57yX9IbUAGA5RKRg9zsUtABEB AAG0J1N0ZWZhbiBFw59lciAoRnJlZUJTRCkgPHNlQGZyZWVic2Qub3JnPokBVAQTAQoAPgIb AwULCQgHAwUVCgkICwUWAwIBAAIeAQIXgBYhBKNx6mWcC+zIK3FTE0frte9a/fVEBQJa8u+q BQkLJQETAAoJEEfrte9a/fVEOeMH/icmdK1eZQvB3U8quJo9VMaZsaTuCMbUE4NThyfsIvIm MCd+rb/yULmMYwqNfjyKB1x4ikR4x+94l+yJoz7K0Usks+eNKDmMGJM6pWWssTigaJubFdVd hVVC+C1QJi7JshYSib08uONoPmO4lv5Az0TDYGtsMzsES2sIlc62c9go5WPGYhQFRbX3Lk6y V6m8OHh+G9XGSj3oPO4UteRwu+SzTdOLunZBWG1wu34+IeZm663D+2gOppQLWpLa2qaTerqw THu377ayZ2B2LPJ5JkvkZeHYPkwDQ+b5PGn0UhfkxPnDVYki5F7qKxvQ5uq1/q9YaCX7mmOl H2yO7tgVsrW5AQ0EVXGJEgEIALEj9qCXMZVucjpcd3QxM/TlUr98m5viEd1z4tCnPUyRWcIC EVtj2h5xMH+2iB0q1+KWhq+NsWtvScmEmfHnsr7dJ1K677OdpDhKVaJk61eeRulFY1R4yb6C 1MMxK+WgYB+vvpG0UeyR0M4uBewcPvRsq4yGUHFQKtLAbMdoPTSryJA+ElnmK1vdY+rPcHgi OIMBZM7ahsPXC0C9K4e5SP9clGyIoMpbfHXdx9q+Rp3zVtlbhyk3BS/xccu/+9pk9ICXL6GR js2sNnJ0wxdU1DsAlC59a5MnSruwiZFwRnkQhr3x6wk97Lg7sLS9jjTnCN7LGlVmSmpOEMy6 uq1AWfUAEQEAAYkBPAQYAQoAJgIbDBYhBKNx6mWcC+zIK3FTE0frte9a/fVEBQJa8u+rBQkL JQEZAAoJEEfrte9a/fVEuesH/2DNxGWnHvWwMyiyhlQtafvDKwEn/wAgR8gHJFodB7emf8rA TnukH7MVttCoHtjN5lvv9RSBHjNTZls5wR/ANlwdRuPQHd8ZGxLe3S6IuUB3zDSwFltLGurO N2kOMhs5mTGyypSa+uw3rtQbUAVYf1oPbiR4FLtiM8FLyEvE95hX5fPq9Qvx9FmN79kmCIEw jDKPqDaUf/OR2fEF0LSIbXHEk4tNqCEwx5DIJ0fp5/z5UzICUAmwxyRs5O/Hre1jzPsMVyud Ml9t7UTOJGKVWwRory1PMnOFxN+iz5/d4FhYSKXF7kfMiFgol4LuWaxJRwbBrr71VGBrRy2a L1nw6Bc= Message-ID: Date: Sat, 11 Jul 2020 09:49:16 +0200 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <202007102350.06ANoWK5097419@gndrsh.dnsmgr.net> Content-Type: text/plain; charset=windows-1252 Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Jul 2020 07:49:22 -0000 Am 11.07.20 um 01:50 schrieb Rodney W. Grimes: >> >>> On Jul 10, 2020, at 12:21 PM, Simon J. Gerraty via freebsd-hackers wrote: >>> >>> Rodney W. Grimes wrote: >>>> Was a merge done from the wrong working directory? >>>> Merges need to be done while cwd is the top level of the src tree. >>> >>> Pretty sure the examples in the svn primer show >>> >>> cd contrib/foo >>> svn merge ^/vendor/FOO/foo/dist . >>> >>> if that's not correct, and update would be useful. >> >> Hi, >> What sjg@ pointed out is the proper way to handle vendor updates/imports. >> Thanks so much! > > I wonder if it is because of a svn copy that was done to > originally create contrib/foo rather than an svn merge? I have no idea whether the cause was the SVN copy, but the mergeinfo was in no way related to the files that had been provided in the contrib area with SVN copy. The mergeinfo was for other paths ending in contrib/bc in project and user directories, completely unrelated to what I'm working in. Anyway, I deleted the mergeinfo from that directory (not the root of the source tree, of course) and recreated the correct mergeinfo with "merge --record-only" from the vendor directory. The resulting mergeinfo looked sane and I have performed the commit. Thank you for your replies on this topic and best regards, STefan From owner-freebsd-hackers@freebsd.org Sat Jul 11 16:32:35 2020 Return-Path: Delivered-To: freebsd-hackers@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id EECBF368461 for ; Sat, 11 Jul 2020 16:32:35 +0000 (UTC) (envelope-from nonesuch@longcount.org) Received: from mail-qk1-x731.google.com (mail-qk1-x731.google.com [IPv6:2607:f8b0:4864:20::731]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4B3wS31LMbz49M1 for ; Sat, 11 Jul 2020 16:32:34 +0000 (UTC) (envelope-from nonesuch@longcount.org) Received: by mail-qk1-x731.google.com with SMTP id l6so8337572qkc.6 for ; Sat, 11 Jul 2020 09:32:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=longcount-org.20150623.gappssmtp.com; s=20150623; h=content-transfer-encoding:from:mime-version:date:subject:message-id :cc:to; bh=QgxGD1vEpUsCkrxjNtzS1RQYLauyMghommnXXTLnHts=; b=2LKmjwaD4cB9f+ZABoCaiYGYFgnCw9FhJXcDsuJm4tJp1nDlhe7PWvgqr05OSSuRkl RSrSFa0A+r/WAbb1iPYBjdp4bBdF0BGCR3qBUrJz+HVcfwD3SVGomAuPPyj3YNdPGC1H Ap5mnM0bxwfUpGSlk8qbYqaOxLJQ6xKFpxc3AQMOiSP0QbYDK9qf/VVuaLaduCH1d01b GVx3KpQ9tT7ecxcEFlZOz2yckAkORPOpEDtqFhl33ed8M7++3NY6R2ubA3tk8qIgUU9D pcfJ/KSTeWzi1q+ovQ6WMzhxCrPedLheSuyt0INhZR4zoLsW9+PeC2xR6gg6lDGz1Xa+ V1DA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:content-transfer-encoding:from:mime-version:date :subject:message-id:cc:to; bh=QgxGD1vEpUsCkrxjNtzS1RQYLauyMghommnXXTLnHts=; b=gsSZvfIVF57MD4TaI8pzMw1EEybGPiyIYXaM9QzUGEHg5xP64i2XC+CqMR+ht6gf+Y OPTqmNVodkaM8tU/c1wxAiOf0LHdDKh7SKW4AP+fnv7WU7ibntDdOat7nqOszCmCfydW zgGWTKXgTJWx/lIkdsEg/DnrIDQ6S2O7k9coPXCmogq82bLW5rE+ePw1ig1XQDYpQ9PT DswxD7q6vDTaCHo3BEXYE9KAUcHPgNyza21Fcr0APuTkrk873guzdyvxKdmPh7Z1C5zD eD0KRqGEGYpPoI4Ttrkw6O5NyAT8o8KiIJbAZ6vOTpD3RM0NRTfV4L1wV60RfSOiSsEB K+Eg== X-Gm-Message-State: AOAM533rBXFR0E6yaE7yhfxNGnGY0x//QDa8xrPbd3aeqYvzZtzlcKI+ k2R14R4Dsf3Wwb1/LxFqS0KJryeT89f23A== X-Google-Smtp-Source: ABdhPJzQKlhi8WG37osElUwxKo85nh+hTdZP5WwaCG7O/SLWbSrrGPUzHmeSgEfGZpq+7f+hGMp4hA== X-Received: by 2002:a05:620a:958:: with SMTP id w24mr75426951qkw.20.1594485153856; Sat, 11 Jul 2020 09:32:33 -0700 (PDT) Received: from [192.168.1.31] (ool-457b63be.dyn.optonline.net. [69.123.99.190]) by smtp.gmail.com with ESMTPSA id y67sm11896584qka.101.2020.07.11.09.32.33 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 11 Jul 2020 09:32:33 -0700 (PDT) From: Mark Saad Mime-Version: 1.0 (1.0) Date: Sat, 11 Jul 2020 12:32:31 -0400 Subject: LACP debug question Message-Id: <906D4A4A-95E1-4AB3-9D64-44DBC3987E51@longcount.org> Cc: NYCBUG Talk To: Hackers freeBSD X-Mailer: iPhone Mail (17F80) X-Rspamd-Queue-Id: 4B3wS31LMbz49M1 X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; dkim=pass header.d=longcount-org.20150623.gappssmtp.com header.s=20150623 header.b=2LKmjwaD; dmarc=none; spf=none (mx1.freebsd.org: domain of nonesuch@longcount.org has no SPF policy when checking 2607:f8b0:4864:20::731) smtp.mailfrom=nonesuch@longcount.org X-Spamd-Result: default: False [-1.68 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; ARC_NA(0.00)[]; R_DKIM_ALLOW(-0.20)[longcount-org.20150623.gappssmtp.com:s=20150623]; NEURAL_HAM_MEDIUM(-0.98)[-0.977]; FROM_HAS_DN(0.00)[]; MV_CASE(0.50)[]; NEURAL_HAM_LONG(-0.97)[-0.970]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-hackers@freebsd.org]; DMARC_NA(0.00)[longcount.org]; NEURAL_SPAM_SHORT(0.07)[0.068]; RCVD_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_SOME(0.00)[]; TO_DN_ALL(0.00)[]; DKIM_TRACE(0.00)[longcount-org.20150623.gappssmtp.com:+]; RCPT_COUNT_TWO(0.00)[2]; RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::731:from]; R_SPF_NA(0.00)[no SPF record]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:~]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; RCVD_TLS_ALL(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; RECEIVED_SPAMHAUS_PBL(0.00)[69.123.99.190:received] Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.33 X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Jul 2020 16:32:36 -0000 All This is a repost from net . I am looking for someone who can help me bette= r understand this LACP disconnect that I am seeing on 12-stable . The server= is a router with Solarflare nics attached to a Pair of arista 7050=E2=80=99= s .=20 Can you help me understand what I am looking at here. I enabled the lacp deb= ug until I finally saw the issue I noted before. Due to some log rotation pa= rt of the message is clipped. Here is a part the full thing is on patebin https://pastebin.com/BGtbxcBf 30 2020-07-09T15:47:04.145885+00:00 ch1-c104-sdn02-mgmt kernel: sfxge0: lacp= _sm_rx_timer: CURRENT -> EXPIRED 31 2020-07-09T15:47:04.145895+00:00 ch1-c104-sdn02-mgmt kernel: sfxge0: Inte= rface stopped DISTRIBUTING, possible flapping 32 2020-07-09T15:47:04.145895+00:00 ch1-c104-sdn02-mgmt kernel: sfxge0: coll= ecting enabled 33 2020-07-09T15:47:04.145896+00:00 ch1-c104-sdn02-mgmt kernel: sfxge0: disa= ble distributing on aggregator [(8000,00-0F-53-69-7C-20,00F2,0000,0000),(800= 0,46-4C-A8-68-13-47,006A,0000,0000)], nports 2 -> 1 34 2020-07-09T15:47:04.145911+00:00 ch1-c104-sdn02-mgmt kernel: sfxge1: lacp= _select_tx_port: waiting transit 35 2020-07-09T15:47:04.145912+00:00 ch1-c104-sdn02-mgmt kernel: marker trans= mit, port=3D6, sys=3D00:0f:53:69:7c:20, id=3D487 36 2020-07-09T15:47:04.145912+00:00 ch1-c104-sdn02-mgmt kernel: sfxge0: sfxg= e1: lacp_select_tx_port: waiting transit 37 2020-07-09T15:47:04.145913+00:00 ch1-c104-sdn02-mgmt kernel: marker trans= mit, port=3D5, sys=3D00:0f:53:69:7c:20, id=3D487 38 2020-07-09T15:47:04.145914+00:00 ch1-c104-sdn02-mgmt kernel: marker respo= nse, port=3D6, sys=3D00:0f:53:69:7c:20, id=3D487 39 2020-07-09T15:47:04.145914+00:00 ch1-c104-sdn02-mgmt kernel: [(8000,00-0F-= 53-69-7C-20,00F2,0000,0000),(8000,46-4C-A8-68-13-47,006A,0000,0000)], speed=3D= 10000000000, nports=3D1 40 2020-07-09T15:47:04.145922+00:00 ch1-c104-sdn02-mgmt kernel: sfxge0: lacp= _select_tx_port: waiting transit 41 2020-07-09T15:47:04.145923+00:00 ch1-c104-sdn02-mgmt kernel: lacp_select_= tx_port: waiting transit 42 2020-07-09T15:47:04.145923+00:00 ch1-c104-sdn02-mgmt kernel: active aggre= gator not changed 43 2020-07-09T15:47:04.145924+00:00 ch1-c104-sdn02-mgmt kernel: lacp_select_= tx_port: waiting transit 44 2020-07-09T15:47:04.145925+00:00 ch1-c104-sdn02-mgmt kernel: marker respo= nse, port=3D5, sys=3D00:0f:53:69:7c:20, id=3D487 45 2020-07-09T15:47:04.145925+00:00 ch1-c104-sdn02-mgmt kernel: lacp_select_= tx_port: waiting transit 46 2020-07-09T15:47:04.145926+00:00 ch1-c104-sdn02-mgmt kernel: new [(8000,0= 0-0F-53-69-7C-20,00F2,0000,0000),(8000,46-4C-A8-68-13-47,006A,0000,0000)] 47 2020-07-09T15:47:04.145926+00:00 ch1-c104-sdn02-mgmt kernel: Set table 1 w= ith 1 ports 48 2020-07-09T15:47:04.145927+00:00 ch1-c104-sdn02-mgmt kernel: sfxge0: mux_= state 4 -> 3 49 2020-07-09T15:47:04.145928+00:00 ch1-c104-sdn02-mgmt kernel: sfxge0: coll= ecting disabled 50 2020-07-09T15:47:04.145930+00:00 ch1-c104-sdn02-mgmt kernel: sfxge0: mux_= state 3 -> 2 51 2020-07-09T15:47:04.145931+00:00 ch1-c104-sdn02-mgmt kernel: sfxge0: lacp= du transmit 52 2020-07-09T15:47:04.145931+00:00 ch1-c104-sdn02-mgmt kernel: actor=3D(800= 0,00-0F-53-69-7C-20,00F2,8000,0005) 53 2020-07-09T15:47:04.145932+00:00 ch1-c104-sdn02-mgmt kernel: actor.state=3D= 8d 54 2020-07-09T15:47:04.145932+00:00 ch1-c104-sdn02-mgmt kernel: partner=3D(8= 000,46-4C-A8-68-13-47,006A,8000,0006) 55 2020-07-09T15:47:04.145933+00:00 ch1-c104-sdn02-mgmt kernel: partner.stat= e=3D37 56 2020-07-09T15:47:04.145935+00:00 ch1-c104-sdn02-mgmt kernel: maxdelay=3D0= 57 2020-07-09T15:47:04.145937+00:00 ch1-c104-sdn02-mgmt kernel: queue flush c= omplete --- Mark Saad | nonesuch@longcount.org=