Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp1318892imm; Wed, 1 Aug 2018 13:54:04 -0700 (PDT) X-Google-Smtp-Source: AAOMgpcjBCfA9xhw3nQmkuwhkipPKUHTdy0s5o/BkanBQ6KU6eaDhRFX6nvgpitUYPsrbqZrhJ1r X-Received: by 2002:a62:6a01:: with SMTP id f1-v6mr28586552pfc.156.1533156843966; Wed, 01 Aug 2018 13:54:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533156843; cv=none; d=google.com; s=arc-20160816; b=fI8i2Sv2EDQd9p+ZnmKNfZvki7i2tvmE9rJELqizjH6H1rN4WcxpN4cy9jcrxpoYuA NUtEoQo3iOT2EFIe2DUkJxWPS/IwRaRaNkcRlbqCnpR70jh+R8QIJVTfytk5VUt5/wiZ AvJOy+saXzNUFiGANGFwdA51CHsHm4B401zubnpob8YeZLEn8dHzfEn6SL6rIGqtsb0/ N3Ps/WXc3sPhZQS134+LicKFkkedfYDF54J3VK1Pr+sMkPom9CMCC/ym9CIC2Q5Fi68s hrpCxD+XUHohxHlOhx6oNm2sIWDFDA4bTryMfmimTYbO0Ua5wIvaArtB4bN32Mm2BiQR 1O8g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature :arc-authentication-results; bh=LR80XNkbkMsNLBnP1iRZ1SZ5lPkf9Pj8qzbArdLki64=; b=nSCrWTZ1tG2aa7/EviBFCmrXEpzI0GtgwiNjrVM/zCx9NX+kMe6kGG6ovvRoLmYbnT HexdrR9BVCUMZm/y2x/YR+AgHK6sCWjVRYiZJyd7rW+bK41YUNlwkxkEN/sWiMgBUNL5 PMq0/QxjmgRPDYYRTqh5DIikMTc0l9tUj+tmGs/ZXHZRaLI5RfCY1DySNlkvZWEfGAAr XOlPq4eU4Mp3/1+ZRDxHtRGn69Pm51+5mGz1T91BQe1Rb+yal0w5Vv+urz0zdtBdNLMS ojhawJMAnRcYEMqMmKpr/DwrJGQsk4NPK4LseOhOJBHoRUb+Z54gByeLzJgMcKmIoGqZ e1tg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=m213dBMq; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a90-v6si15924034plc.285.2018.08.01.13.53.49; Wed, 01 Aug 2018 13:54:03 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=m213dBMq; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732178AbeHAWk2 (ORCPT + 99 others); Wed, 1 Aug 2018 18:40:28 -0400 Received: from mail-pf1-f196.google.com ([209.85.210.196]:41055 "EHLO mail-pf1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731482AbeHAWk1 (ORCPT ); Wed, 1 Aug 2018 18:40:27 -0400 Received: by mail-pf1-f196.google.com with SMTP id y10-v6so8460731pfn.8 for ; Wed, 01 Aug 2018 13:52:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=LR80XNkbkMsNLBnP1iRZ1SZ5lPkf9Pj8qzbArdLki64=; b=m213dBMqUOyE8RjiwWqohEZFELxxjz1QfedFr//F/MwoHYEeQG21bffm8h0DZt+YNR /uh3faj8S+V6p3HBoNKfz7jx6lr+D6tKKIATP6jI6sGBz7b4zADdovQsPaYRQ0gnJj14 Dz5L2nsShIQXlq+VK+8wKrITmIfn7GIuziWRXvdeuZuekYY++NePRWieNDTKYm6kH/ZL nGLwRQSa86pQGIOnYM4NxCPLD36+bhmwS0UCHVXwOVICC2hB4BSjbGSBdEvEqPy6JdHC T07TQkBrj4trjwEA0pVsDpFgGmJ7wbmLaTsvZten/F3uOPMXOdv7NwZUVEACykK6Z9Uv PY7w== 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=LR80XNkbkMsNLBnP1iRZ1SZ5lPkf9Pj8qzbArdLki64=; b=e2ObkHnMt2FWwcMMlE+gg0z0U5RFHr/9z/oUTVCnz/YMkEGBw8q4/5XqmsjsgZZSoF WmJYY1vetIOP7uRfkEIlu/hGNYfmEp2V7GCAbgQDBQWUonP/3cDfbSsYUEbQHn6uEtj7 zUFw1nsnA2jN3J0zc+wDNTXMvKkU08PJl2D6UpfYbSqNooAD431D2XDUbBU2WC/UPbMQ k3UC6E1RzmJgj2ciQ/isS9IQy0LTMZ1n8GvriL4zVyGqhCgBlxwCqNdvrzGf1IzQovgf QCBMitx3s1k8GCKgIwFvltxFeiQUqHToh5zqLaRV1E3bE9RcH6fPWsZTmKw40qJSL9YI /60Q== X-Gm-Message-State: AOUpUlHZeUyvqeFfx9/gQu/vlTZmTskfWdkNN0ZZED2IyX74GUD1G/+a 4s8j6/Q7gxfKR2FW+kSqUQwVhFSMj/6HUwQb14POCA== X-Received: by 2002:a63:d916:: with SMTP id r22-v6mr25548806pgg.381.1533156770336; Wed, 01 Aug 2018 13:52:50 -0700 (PDT) MIME-Version: 1.0 References: <20180801182258.17834-1-ndesaulniers@google.com> <78c667f9-5c8b-3835-83eb-4b59e27e4f7e@bell.net> In-Reply-To: <78c667f9-5c8b-3835-83eb-4b59e27e4f7e@bell.net> From: Nick Desaulniers Date: Wed, 1 Aug 2018 13:52:39 -0700 Message-ID: Subject: Re: [PATCH] parisc: prefer _THIS_IP_ and _RET_IP_ statement expressions To: dave.anglin@bell.net Cc: deller@gmx.de, jejb@parisc-linux.org, Nathan Chancellor , Thomas Gleixner , pravin.shedge4linux@gmail.com, Kate Stewart , Greg KH , linux-parisc@vger.kernel.org, LKML Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Dave, thanks for the quick review! On Wed, Aug 1, 2018 at 1:10 PM John David Anglin wrote: > > On 2018-08-01 2:22 PM, Nick Desaulniers wrote: > > As part of the effort to reduce the code duplication between _THIS_IP_ > > and current_text_addr(), let's consolidate callers of > > current_text_addr() to use _THIS_IP_. > Using the generic _THIS_IP_ results in significantly longer code than > the parisc implementation > of current_text_addr(). It might be worthwhile to file a bug with your compiler vendor. It seems like there may be a better way to generate code for this construct. Also, I'm curious how hot this code is? I assume in general that the C construct may be larger than the inline assembly, but I'm curious if this introduces a performance regression or just makes the code larger? Do you have stats on the size difference and performance differences? What's more important to me is whether the patch is correct... > It also results in a local label in the text. > This breaks the unwind data > for the function with the label in 32-bit kernels. The implementation > of current_text_addr() > doesn't add a label. ... oh, I guess I'm surprised that the label ends up in the code, vs there just being a constant generated. Can you send me the disassembly? Also, I'm curious how does having the label present in the text break the unwinder? (I'm not familiar with how unwinding works beyond following frame pointers). > _THIS_IP_ should be defined using > current_text_addr() on parisc. I'm trying to eliminate current_text_addr() in the kernel, as it only has 4 call sites (3 are arch specific). What are your thoughts on making the current parisc current_text_addr() just a static function (or statement expression that's local to) in arch/parisc/kernel/unwind.c? -- Thanks, ~Nick Desaulniers