From owner-svn-src-all@freebsd.org Mon Dec 7 15:28:05 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BD3599B76C4 for ; Mon, 7 Dec 2015 15:28:05 +0000 (UTC) (envelope-from steven@multiplay.co.uk) Received: from mail-wm0-x22d.google.com (mail-wm0-x22d.google.com [IPv6:2a00:1450:400c:c09::22d]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5051C1D1F for ; Mon, 7 Dec 2015 15:28:05 +0000 (UTC) (envelope-from steven@multiplay.co.uk) Received: by wmec201 with SMTP id c201so170930347wme.0 for ; Mon, 07 Dec 2015 07:28:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=multiplay-co-uk.20150623.gappssmtp.com; s=20150623; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-type:content-transfer-encoding; bh=ruCahpWNeT/30ldHW0DygOqYR7ji8+QwDMjYf9xMEs8=; b=mmLexwTd7Zxc5ZCBLsBKs0jOYoJMGTZkJ8IcxV1nXZM7xmNL6Anji5IYAE1prCR1W0 Qh+Oz7mTYKWXe4xifTfCshmaYhKb9iNz0pW5nkPkrHTlVTbb5tjPRp+fV1kIGOhksiUA XF57YchmeGgMbYruefgPDTNosjJ0j7YnG7aMerQg6gBRCWY+y7HaTnLLlcn2FUsdYu1X Laay1W5GWZLXbIEYTjUF5GEt94PwqJeDbypWePlJlFptxNOY77mhPoXzJvqEuEI40n2r W3IZOBScdPCqX/ugFGdHIdozMScY/Ney/dUJWkV5K6YP3ehCdwqBCtIlKwswaN5ZzuKT h3mw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-type :content-transfer-encoding; bh=ruCahpWNeT/30ldHW0DygOqYR7ji8+QwDMjYf9xMEs8=; b=g9JHKRH31BGScgdQNAUk10were1SrNJh26O9pZ9JF2ycB79/AMS/urYuMe7ZUL30AI jgbD4hgO4CWBvou84tW/9ad2fiyki6FmTpiqjLJDhk+fjd80eVSnwbTXNm0CaQq/Noxv 6J23+RcykczelWOPo51NJKP+lbYOsnCq9+4yhKyxqRL/GkA40U5lnrl6dBm5FNsaTRaj RFC1BQgzU9YJlmzE90+lvkHyZNFoKzfvAF6NmY8ltXKSL5Q56R//Va0GJxgJioJltw+x sgqJkjkvEL/amXTu2XwtLO3JcQLwn7yj7tTt5iK6MFcPD45U62JPuSkcrTUDLDi6JTmO aJog== X-Gm-Message-State: ALoCoQlI7kv4boAB3Upkt3I1sPHcNhR1jvIrRsH/4QFRJzdN4DqfvWzpis8q19phCqUz4D18e6OY X-Received: by 10.194.84.4 with SMTP id u4mr39817652wjy.149.1449502082992; Mon, 07 Dec 2015 07:28:02 -0800 (PST) Received: from [10.10.1.58] (liv3d.labs.multiplay.co.uk. [82.69.141.171]) by smtp.gmail.com with ESMTPSA id q74sm22238472wmd.0.2015.12.07.07.28.01 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 07 Dec 2015 07:28:01 -0800 (PST) Subject: Re: svn commit: r291911 - head/sys/dev/iscsi To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201512070256.tB72u8C6057988@repo.freebsd.org> <20151207112235.GA12517@brick.home> <56656EA9.6050002@freebsd.org> <20151207131032.GA12870@brick.home> From: Steven Hartland Message-ID: <5665A586.4030304@multiplay.co.uk> Date: Mon, 7 Dec 2015 15:28:06 +0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.4.0 MIME-Version: 1.0 In-Reply-To: <20151207131032.GA12870@brick.home> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Dec 2015 15:28:05 -0000 On 07/12/2015 13:10, Edward Tomasz NapieraƂa wrote: > isn't supposed to remove working iSCSI sessions. >> I didn't notice your change in head / stable/10 compared to releng, so >> I'm testing further updates now. > Well, the difference is pretty crucial here - previously, the purpose of > iscsi_shutdown() was to disconnect the sessions during shutdown. Now it > doesn't do that at all - established connections are kept intact, it just > disables reconnections. And for this to work, it needs to happen as soon > as possible during shutdown. More information on why this needs to happen as soon as possible would be appreciated. > >> Currently shutdown is run too early and actually doesn't actually >> terminate any sessions. > What does "currently" mean in this context? HEAD / stable/10. > >> My current theory is the issue you tried to fix in 286226 is actually >> caused by the iscsi_maintenance_thread preferring reconnect over >> terminate, so what you where seeing was the terminate never action for >> reconnecting sessions. I'm currently trying to validate that theory now. >> >> If I'm right then the fix should be to revert the majority of 286226 and >> move the processing of terminate above reconnect in >> iscsi_maintenance_thread. > I don't think that would work. The reason that the sessions don't > terminate (in 11-CURRENT) is that they are not supposed to - unmounting > filesystems will write data to LUNs, and we don't want to break that. Agreed, which is why I believe it needs to do so after filesystem shutdown, not before, which is what was happening prior to r286226. > The only reason iscsi_shutdown() exists is to prevent hang on shutdown > when there are sessions that require reconnection and there is no way > for it to succeed, because of iscsid is not running. It should also really cleanup and disconnect from the SAN, which it currently doesn't. I've reproduced the hang you described on shutdown. It should be noted that if there are outstanding writes we still see a hang even with r286226. I've posted a review https://reviews.freebsd.org/D4429, which I believe achieves your goal as well as ensuring the sessions are closed before reboot, so if we can take discussion there that would be great. Hopefully it won't take to long to conclude, if however it does I'll backout r291911 as on its own doesn't help. Thanks for everyone's feedback, so far, its always appreciated :) Regards Steve