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=-2.5 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_PASS,USER_AGENT_MUTT autolearn=ham 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 8B987C43387 for ; Tue, 1 Jan 2019 21:41:22 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 56A98218A4 for ; Tue, 1 Jan 2019 21:41:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726571AbfAAVlV (ORCPT ); Tue, 1 Jan 2019 16:41:21 -0500 Received: from mx1.redhat.com ([209.132.183.28]:59960 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726080AbfAAVlU (ORCPT ); Tue, 1 Jan 2019 16:41:20 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id CF87087637; Tue, 1 Jan 2019 21:41:20 +0000 (UTC) Received: from krava (ovpn-204-83.brq.redhat.com [10.40.204.83]) by smtp.corp.redhat.com (Postfix) with SMTP id C16785C1B2; Tue, 1 Jan 2019 21:41:18 +0000 (UTC) Date: Tue, 1 Jan 2019 22:41:17 +0100 From: Jiri Olsa To: Alexey Budankov Cc: Arnaldo Carvalho de Melo , Ingo Molnar , Peter Zijlstra , Namhyung Kim , Alexander Shishkin , Andi Kleen , linux-kernel Subject: Re: [PATCH v2 2/4] perf record: bind the AIO user space buffers to nodes Message-ID: <20190101214117.GI13760@krava> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Tue, 01 Jan 2019 21:41:20 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Dec 24, 2018 at 03:24:36PM +0300, Alexey Budankov wrote: SNIP > +static void perf_mmap__aio_free(void **data, size_t len __maybe_unused) > +{ > + zfree(data); > +} > + > +static void perf_mmap__aio_bind(void *data __maybe_unused, size_t len __maybe_unused, > + int cpu __maybe_unused, int affinity __maybe_unused) > +{ > +} > +#endif > + > static int perf_mmap__aio_mmap(struct perf_mmap *map, struct mmap_params *mp) > { > int delta_max, i, prio; > @@ -177,11 +220,13 @@ static int perf_mmap__aio_mmap(struct perf_mmap *map, struct mmap_params *mp) > } > delta_max = sysconf(_SC_AIO_PRIO_DELTA_MAX); > for (i = 0; i < map->aio.nr_cblocks; ++i) { > - map->aio.data[i] = malloc(perf_mmap__mmap_len(map)); > + size_t mmap_len = perf_mmap__mmap_len(map); > + perf_mmap__aio_alloc(&(map->aio.data[i]), mmap_len); > if (!map->aio.data[i]) { > pr_debug2("failed to allocate data buffer area, error %m"); > return -1; > } > + perf_mmap__aio_bind(map->aio.data[i], mmap_len, map->cpu, mp->affinity); this all does not work if bind fails.. I think we need to propagate the error value here and fail jirka