From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 69412 invoked by alias); 12 Nov 2018 08:53:48 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 67895 invoked by uid 89); 12 Nov 2018 08:53:45 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_PASS autolearn=ham version=3.3.2 spammy=yours X-HELO: mx1.suse.de Received: from mx2.suse.de (HELO mx1.suse.de) (195.135.220.15) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 12 Nov 2018 08:53:44 +0000 Received: from relay1.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id D743DADF1; Mon, 12 Nov 2018 08:53:41 +0000 (UTC) Subject: Re: [PATCH][RFC] Come up with -flive-patching master option. To: Qing Zhao Cc: Jan Hubicka , Martin Jambor , live-patching@vger.kernel.org, gcc Patches References: <1a023bdc-28a6-eb41-b449-4d096f12064f@suse.cz> <048D9997-B7AF-444A-BF7E-79944DE8F174@oracle.com> <3E37D3A8-2D19-41C2-BA8A-8F0EFA1B4D5C@oracle.com> <10a54034-279b-a406-8466-55558effbf24@suse.cz> <20181003090457.GJ57692@kam.mff.cuni.cz> <54a75932-201b-671c-0a63-d1a5d8d7b562@suse.cz> <90c91045-cb9d-0bd2-fad3-d16426ceede6@suse.cz> <20181105095135.j3mnzox6rkktkoto@kam.mff.cuni.cz> <629b20d2-7b0b-9342-a64a-d12eb6e6a6b7@suse.cz> <20181108145909.5eh5ccen7a7elspe@kam.mff.cuni.cz> <173116c6-d51c-3bef-5382-38593e032f82@suse.cz> From: =?UTF-8?Q?Martin_Li=c5=a1ka?= Message-ID: <8f467934-c088-9b60-c4d3-c19c2e03defd@suse.cz> Date: Mon, 12 Nov 2018 08:53:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.3.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-IsSubscribed: yes X-SW-Source: 2018-11/txt/msg00898.txt.bz2 On 11/12/18 3:28 AM, Qing Zhao wrote: > Hi, > > >> On Nov 10, 2018, at 2:51 AM, Martin Liška wrote: >> >> On 11/9/18 6:43 PM, Qing Zhao wrote: >>> Hi, Martin, >>> >>> thanks a lot for the previous two new options for live-patching. >>> >>> >>> I have two more questions below: >> >> Hello. >> >>> >>> 1. do we still need new options to disable the following: >>> A. unreachable code/variable removal? >> >> I hope it's guarded with newly added option -fipa-reference-addressable. Correct me >> if I'm wrong. > > The followings are some previous discussions on this: > > “ >>>> >>>> We perform discovery of functions/variables with no address taken and >>>> optimizations that are not valid otherwise such as duplicating them >>>> or doing skipping them for alias analysis (no flag to disable) >>> >>> Can you be please more verbose here? What optimizations do you mean? > > See ipa_discover_readonly_nonaddressable_vars. If addressable bit is > cleared we start analyzing uses of the variable via ipa_reference or so. > If writeonly bit is set, we start removing writes to the variable and if > readonly bit is set we skip any analysis about whether vairable changed. > “ > > the new -fipa-reference-addressable is to control the above, seems not the unreachable code/variable removal? > >> >>> B. Visibility changes with -flto and/or -fwhole-program? >> >> The options are not used in linux kernel, thus I didn't consider. > > Okay, I see. > >> >>> >>> 2. for this new patch, could you please explain a little bit more on the problem? >> >> We want to enable a single option that will disable all possible (and future) optimizations >> that influence live patching. > > Okay, I see. > > I am also working on a similar option as yours, but make the -flive-patching as two level control: > > +flive-patching > +Common RejectNegative Alias(flive-patching=,inline-clone) > + > +flive-patching= > +Common Report Joined RejectNegative Enum(live_patching_level) Var(flag_live_patching) Init(LIVE_NONE) > +-flive-patching=[inline-only-static|inline-clone] Control optimizations to provide a safe comp for live-patching purpose. > > the implementation for -flive-patching=inline-clone (the default) is exactly as yours, the new level -flive-patching=inline-only-static > is to only enable inlining of static function for live patching, which is important for multiple-processes live patching to control memory > consumption. > > (please see my 2nd version of the -flive-patching proposal). > > I will send out my complete patch in another email. Hi, sure, works for me. Let's make 2 level option. Martin > > thanks. > > Qing > >