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=-8.3 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=unavailable 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 E9995C43457 for ; Fri, 9 Oct 2020 01:35:39 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 40DD622263 for ; Fri, 9 Oct 2020 01:35:38 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="OlU1oasS" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 40DD622263 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 4F1276B005C; Thu, 8 Oct 2020 21:35:38 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 452346B005D; Thu, 8 Oct 2020 21:35:38 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 31A5C6B0062; Thu, 8 Oct 2020 21:35:38 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0083.hostedemail.com [216.40.44.83]) by kanga.kvack.org (Postfix) with ESMTP id 002D66B005C for ; Thu, 8 Oct 2020 21:35:37 -0400 (EDT) Received: from smtpin30.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 7F5C41EE6 for ; Fri, 9 Oct 2020 01:35:37 +0000 (UTC) X-FDA: 77350669914.30.hall40_180802c271dc Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin30.hostedemail.com (Postfix) with ESMTP id CB5CD180B3C8B for ; Fri, 9 Oct 2020 01:35:36 +0000 (UTC) X-HE-Tag: hall40_180802c271dc X-Filterd-Recvd-Size: 6514 Received: from mail-pf1-f196.google.com (mail-pf1-f196.google.com [209.85.210.196]) by imf29.hostedemail.com (Postfix) with ESMTP for ; Fri, 9 Oct 2020 01:35:36 +0000 (UTC) Received: by mail-pf1-f196.google.com with SMTP id f19so5465235pfj.11 for ; Thu, 08 Oct 2020 18:35:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=9zZePxv1+ayzDeRnmmneH5yJgguBhYNYuZPZ3ryB+aY=; b=OlU1oasSdq2JHGNSbvBEe2LNN/ZY3bfSNgkbsIpJQP5mL42tno8ZPR4A7oc0AELxAs mf7khMvAXcvIYWlm8MDYaxEvk1f9Fw18WqGLx3h9fijdqzXK1nfaH+5jTkQuvH7eJHtd bksuSzC901/tTuvI5ZVxdKT0opmMxQHVHHQ66EDk5a+HingLIXvMZGgPgvxZWX+8y7BT ew/H/8odV/o6SXNc3aQUFDx/oG9sdbetPEtWe0/ceqV3QIbOifMhZc0R9k1jk9mPY2f+ aCU5LY8VWY8X7wNj26XsDH6P/W6ri00hVXlit9I+2PhKmGE6ojB9O7UbOtaf/VYW6ce/ kXqg== 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:user-agent; bh=9zZePxv1+ayzDeRnmmneH5yJgguBhYNYuZPZ3ryB+aY=; b=WRUV9aivsaK5VcNC6UjtGcEn783y1vrhLPOxRw9L5UV3Q4ujTiCf3PRHyDLnS8ECoH X0kuck9tKo5EnMAV8fXCVclhWxZW9Ck9DS50Ro0N1x2ReMHZ3qpP0ThjhpUoYmiP/BMV hInt7bXFMvBakkElFrIoCdhhZ7nPJ/20Woijx2j0odO80cXgjDHa3OWIquzDTIVbRD+v UWF3g7bdgfW/QyZ7cKPZzIjo0MfiDoWxzuiYn1XWCDbWpa5kwAGTKY5cUviLYy/rztXW MS/vfeoHC4MlucWMaboseAjBjrr8xDvbe/Pa8Sy2C7iJJJMJpPtAyj5S91uPs51R60kx fg8Q== X-Gm-Message-State: AOAM533v/aYQQ+Irg1hNNx1i/VPJDJ9S3KvOBWuiTwF7O7ceiYeA1KxE qKo10cUAE6qvmTE8PsF37Ew= X-Google-Smtp-Source: ABdhPJwoxvQFMmIFCUXhVinnrWxfYcLbTUVLlmTrPwZniYMJGUfPt8z22uZXVXXeAsxzVofzj2oTZA== X-Received: by 2002:a63:5c5f:: with SMTP id n31mr1312474pgm.397.1602207335265; Thu, 08 Oct 2020 18:35:35 -0700 (PDT) Received: from js1304-desktop ([114.206.198.176]) by smtp.gmail.com with ESMTPSA id j8sm8733508pfr.121.2020.10.08.18.35.30 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 08 Oct 2020 18:35:34 -0700 (PDT) Date: Fri, 9 Oct 2020 10:35:12 +0900 From: Joonsoo Kim To: "Eric W. Biederman" Cc: Hari Bathini , kernel-team@lge.com, Michal Hocko , Minchan Kim , "Aneesh Kumar K . V" , Rik van Riel , "Rafael J . Wysocki" , LKML , Christian Koenig , Christoph Hellwig , Linux Memory Management List , Huang Rui , Kexec Mailing List , Pavel Machek , Johannes Weiner , Andrew Morton , Laura Abbott , Mel Gorman , Roman Gushchin , Vlastimil Babka Subject: Re: [RFC][PATCH] kexec: Teach indirect pages how to live in high memory Message-ID: <20201009013500.GA26932@js1304-desktop> References: <1588130803-20527-1-git-send-email-iamjoonsoo.kim@lge.com> <1588130803-20527-4-git-send-email-iamjoonsoo.kim@lge.com> <87h7wzvjko.fsf@x220.int.ebiederm.org> <87ftcfpzjn.fsf@x220.int.ebiederm.org> <87368fmkel.fsf_-_@x220.int.ebiederm.org> <54a53bfe-6929-2790-9b1d-943e9f47cd62@linux.ibm.com> <87sggekyzv.fsf@x220.int.ebiederm.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87sggekyzv.fsf@x220.int.ebiederm.org> User-Agent: Mutt/1.5.24 (2015-08-30) 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: On Tue, May 05, 2020 at 01:39:16PM -0500, Eric W. Biederman wrote: > Hari Bathini writes: > > > On 05/05/20 3:29 am, Eric W. Biederman wrote: > >> > >> Recently a patch was proposed to kimage_alloc_page to slightly alter > >> the logic of how pages allocated with incompatible flags were > >> detected. The logic was being altered because the semantics of the > >> page alloctor were changing yet again. > >> > >> Looking at that case I realized that there is no reason for it to even > >> exist. Either the indirect page allocations and the source page > >> allocations could be separated out, or I could do as I am doing now > >> and simply teach the indirect pages to live in high memory. > >> > >> This patch replaced pointers of type kimage_entry_t * with a new type > >> kimage_entry_pos_t. This new type holds the physical address of the > >> indirect page and the offset within that page of the next indirect > >> entry to write. A special constant KIMAGE_ENTRY_POS_INVALID is added > >> that kimage_image_pos_t variables that don't currently have a valid > >> may be set to. > >> > >> Two new functions kimage_read_entry and kimage_write_entry have been > >> provided to write entries in way that works if they live in high > >> memory. > >> > >> The now unnecessary checks to see if a destination entry is non-zero > >> and to increment it if so have been removed. For safety new indrect > >> pages are now cleared so we have a guarantee everything that has not > >> been used yet is zero. Along with this writing an extra trailing 0 > >> entry has been removed, as it is known all trailing entries are now 0. > >> > >> With highmem support implemented for indirect pages > >> kimage_image_alloc_page has been updated to always allocate > >> GFP_HIGHUSER pages, and handling of pages with different > >> gfp flags has been removed. > >> > >> Signed-off-by: "Eric W. Biederman" > > > > Eric, the patch failed with data access exception on ppc64. Using the below patch on top > > got me going... > > Doh! Somehow I thought I had put that logic or something equivalent > into kimage_write_entry and it appears I did not. I will see if I can > respin the patch. > > Thank you very much for testing. Hello, Eric. It seems that this patch isn't upstreamed. Could you respin the patch? I've tested this one on x86_32 (highmem enabled) and it works well. Thanks.