From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1531BC54E4A for ; Tue, 12 May 2020 12:03:21 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id D493B2072B for ; Tue, 12 May 2020 12:03:20 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D493B2072B Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=xmission.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 724469000B1; Tue, 12 May 2020 08:03:20 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 6D4C3900036; Tue, 12 May 2020 08:03:20 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 5C2E19000B1; Tue, 12 May 2020 08:03:20 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0219.hostedemail.com [216.40.44.219]) by kanga.kvack.org (Postfix) with ESMTP id 4082B900036 for ; Tue, 12 May 2020 08:03:20 -0400 (EDT) Received: from smtpin12.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 00C458248047 for ; Tue, 12 May 2020 12:03:20 +0000 (UTC) X-FDA: 76807931760.12.wool29_916dbb5659426 X-HE-Tag: wool29_916dbb5659426 X-Filterd-Recvd-Size: 4360 Received: from out02.mta.xmission.com (out02.mta.xmission.com [166.70.13.232]) by imf38.hostedemail.com (Postfix) with ESMTP for ; Tue, 12 May 2020 12:03:19 +0000 (UTC) Received: from in02.mta.xmission.com ([166.70.13.52]) by out02.mta.xmission.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jYTcs-0000tl-L0; Tue, 12 May 2020 06:03:10 -0600 Received: from ip68-227-160-95.om.om.cox.net ([68.227.160.95] helo=x220.xmission.com) by in02.mta.xmission.com with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.87) (envelope-from ) id 1jYTcr-0007id-TX; Tue, 12 May 2020 06:03:10 -0600 From: ebiederm@xmission.com (Eric W. Biederman) To: David Hildenbrand Cc: James Morse , kexec@lists.infradead.org, linux-mm@kvack.org, linux-arm-kernel@lists.infradead.org, Dave Young , Baoquan He References: <20200501165701.24587-1-james.morse@arm.com> <40b07632-b044-d1cd-96a2-81eec3da93e7@redhat.com> <8736892l92.fsf@x220.int.ebiederm.org> <87h7wmtna1.fsf@x220.int.ebiederm.org> <4d5f69b6-fdfd-a461-0ac9-6d05636508f1@redhat.com> Date: Tue, 12 May 2020 06:59:38 -0500 In-Reply-To: <4d5f69b6-fdfd-a461-0ac9-6d05636508f1@redhat.com> (David Hildenbrand's message of "Tue, 12 May 2020 09:45:16 +0200") Message-ID: <87sgg5s6s5.fsf@x220.int.ebiederm.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-XM-SPF: eid=1jYTcr-0007id-TX;;;mid=<87sgg5s6s5.fsf@x220.int.ebiederm.org>;;;hst=in02.mta.xmission.com;;;ip=68.227.160.95;;;frm=ebiederm@xmission.com;;;spf=neutral X-XM-AID: U2FsdGVkX1/rnctvPahPVR1lDa2sHTDjDmoQMCyCAbM= X-SA-Exim-Connect-IP: 68.227.160.95 X-SA-Exim-Mail-From: ebiederm@xmission.com Subject: Re: [PATCH] kexec: Discard loaded image on memory hotplug X-SA-Exim-Version: 4.2.1 (built Thu, 05 May 2016 13:38:54 -0600) X-SA-Exim-Scanned: Yes (on in02.mta.xmission.com) X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: David Hildenbrand writes: >> >> Maybe we have enough information to fixup the loaded kexec image >> in the kexec_file_load case, we certainly don't in the ordinary >> kexec_load case. > > Yes, that's also what I mentioned in my reply to Baoquan. > >> >> For now I want to stick to the simplest thing we can do which is either >> blocking the memory hotplug operation (if that is possible) or >> dropping the loaded kexec image. > > Yes, the latter is the best for now. It's simple. > > I am suggesting to add explicit callbacks to > add_memory()/remove_memory(), and calling the invalidation from there - > because I see various issues with the memory notifier approach (racy, > false positives, never called if memory is not onlined). Ok so we are in agreement. Correct patch. Wrong trigger condition. Eric